asp.net - Delete_Click event with Multiple Gridviews within Update Panel -


i have page updatepanel , 5 gridviews. have delete button outside of gridview allow multiple files deleted quickly. possible use 1 delete button click event of gridviews?

  protected sub deletepacketbtn_click(sender object, e eventargs) handles deletepacketbtn.click     'loop through rows in gridview     each gvrow c1gridviewrow in packetgrid.rows         'finiding checkbox control in gridview particular row         dim chkdelete checkbox = ctype(gvrow.findcontrol("chkdelete"), checkbox)         'condition check checkbox selected or not         if chkdelete.checked             'getting id of particular row using datakey value             dim fileid integer = convert.toint32(packetgrid.datakeys(gvrow.rowindex).value)             packetdatasource.deleteparameters("original_pkt_key").defaultvalue = fileid.tostring             packetdatasource.delete()          end if     next     packetgrid.databind()  end sub 

yes, sender gridview caused delete event raised.

if cast sender gridview (don't know correct vb syntax, sorry), you'll know 1 caused event.

the following code above applicable delete event of gridview, not button-click.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -