Assign confirm when doing GetPostBackClientHyperLink on a gridview

  • Thread starter Thread starter tiptechno
  • Start date Start date
T

tiptechno

hello,

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

e.Row.Cells[3].Attributes["onclick"] =
Page.ClientScript.GetPostBackClientHyperlink(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...
 
try:

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



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



bruce barker said:
try:

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



-- bruce (sqlwork.com)


tiptechno said:
hello,

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

e.Row.Cells[3].Attributes["onclick"] =
Page.ClientScript.GetPostBackClientHyperlink(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...
 
Back
Top