<asp:Button runat="server" ID="btnsubmit" Text="Submit" OnClick="btnsubmit_Click" UseSubmitBehavior="false" OnClientClick="this.disabled=true;this.value='Please wait..';" /> For <asp:imagebutton> usesubmitbehavior will not work hence for this: <asp:ImageButton runat=”server” ID=”btImageButton” ImageUrl=”/images/submit.jpeg” OnClick=”btImageButton_Click” OnClientClick=”javascript: Submit(this);” /> <script type=”text/javascript” language=”javascript”> function Submit(c){ Page_ClientValidate(); if (Page_IsValid){ c.disabled = true __doPostBack(c.name, ”); } return Page_IsValid; } </script>
Tuesday, December 20, 2011
Disable button after submit in Asp.net
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment