Assign confirm when doing GetPostBackClientHyperLink on a gridview

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?dGlwdGVjaG5v?=

    Assign confirm when doing GetPostBackClientHyperLink on a gridview

    hello,

    i was wondering how to attach a js confirm to the following command

    e.Row.Cells[3].Attributes["onclick"] =
    Page.ClientScri pt.GetPostBackC lientHyperlink( this.gvGrid, "MyCommand$ " +
    "value123") ;

    .... I have this in the RowDataBound of the GridView, it works fine, just
    want to attach a js confirmation to it so it can be cancelled before posting
    back.

    thanks...
  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Assign confirm when doing GetPostBackClie ntHyperLink on a gridview

    try:

    e.Row.Cells[3].Attributes["onclick"] = "if (!confirm('do it?')) return
    false;" +
    Page.ClientScri pt.GetPostBackC lientHyperlink( this.gvGrid, "MyCommand$ "
    +
    "value123") ;



    -- bruce (sqlwork.com)


    "tiptechno" wrote:
    hello,
    >
    i was wondering how to attach a js confirm to the following command
    >
    e.Row.Cells[3].Attributes["onclick"] =
    Page.ClientScri pt.GetPostBackC lientHyperlink( this.gvGrid, "MyCommand$ " +
    "value123") ;
    >
    ... I have this in the RowDataBound of the GridView, it works fine, just
    want to attach a js confirmation to it so it can be cancelled before posting
    back.
    >
    thanks...

    Comment

    • =?Utf-8?B?dGlwdGVjaG5v?=

      #3
      RE: Assign confirm when doing GetPostBackClie ntHyperLink on a grid

      Yes, that works. Thank you very much bruce :-)



      "bruce barker" wrote:
      try:
      >
      e.Row.Cells[3].Attributes["onclick"] = "if (!confirm('do it?')) return
      false;" +
      Page.ClientScri pt.GetPostBackC lientHyperlink( this.gvGrid, "MyCommand$ "
      +
      "value123") ;
      >
      >
      >
      -- bruce (sqlwork.com)
      >
      >
      "tiptechno" wrote:
      >
      hello,

      i was wondering how to attach a js confirm to the following command

      e.Row.Cells[3].Attributes["onclick"] =
      Page.ClientScri pt.GetPostBackC lientHyperlink( this.gvGrid, "MyCommand$ " +
      "value123") ;

      ... I have this in the RowDataBound of the GridView, it works fine, just
      want to attach a js confirmation to it so it can be cancelled before posting
      back.

      thanks...

      Comment

      Working...