javascript - ASP Alert text before invoke onClick method -
basically have button , corresponding onclick method below:
<asp:button id="button1" runat="server" cssclass="button_short" text="save & submit" onclick="btnsave_click"></asp:button> protected void btnsave_click(object sender, eventargs e) {...}
now want have javascript confirm
when button being click i've no idea how trigger btnsave_click
method right after user click "ok"
try
<asp:button id="button1" runat="server" cssclass="button_short" text="save" onclick="btnsave_click" onclientclick="return confirm('are sure?');"> </asp:button>.
Comments
Post a Comment