javascript not firing after setting onclientclick in gridview rowdatabound -


i want fire javascript confirm deleting row.

this rowdatabound

private sub gridslide_rowdatabound(byval sender object, byval e system.web.ui.webcontrols.gridviewroweventargs) handles gridslide.rowdatabound     if e.row.rowtype = datacontrolrowtype.datarow         directcast(e.row.findcontrol("linkdelete"), linkbutton).attributes.add("onclientclick", "javascript:deleteslide('" & convert.tostring(e.row.rowindex) & "')")     end if  end sub 

this javascript

function deleteslide(var_row) {     var blnresponse = null;     var strmessage = '';     try {         strmessage = 'are sure want delete slide data?';         blnresponse = window.confirm(strmessage);         if (blnresponse) {             __dopostback('deleteslide()', var_row  );         }     }     catch (err) {         alert('deleteslide - ' + err.description);     } } 

but when click delete link button, javascript won't fire.

what's problem?

p.s. tried using commandargument , container.dataitemindex caused whole lot more errors ended using rowdatabound.

try this:

directcast(e.row.findcontrol("linkdelete"), linkbutton).onclientclick = "javascript:deleteslide('" & convert.tostring(e.row.rowindex) & "')"; 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -