Pass value from javascript function in client side to server side in asp.net -
the web form has grid view contains delete link. on clicking link, confirmation message should displayed. using function displays confirmation dialog box. on clicking ok button, respective record should deleted. how can pass value on clicking ok button in dialog box perform delete operation?
void confirmmsg(string cmsg) { type cstype = this.gettype(); // clientscriptmanager reference page class. clientscriptmanager cs = page.clientscript; string cstext = "confirm('" + cmsg + "');"; cs.registerstartupscript(cstype, "popupscript", cstext, true); }
just use line in place of ur delete button.nothing needed:
<asp:linkbutton id="lbdelete" runat="server" onclientclick="return confirm('are sure want delete company information?')" causesvalidation="false" commandname="delete" text="delete"></asp:linkbutton>
Comments
Post a Comment