<%@ Page Language="C#" %> <html> <head id="Head1" runat="server"> <script type="text/javascript"> function Validate() { alert("Validate Controls"); var isValid = false; if (isValid) document.forms[0].submit(); return false; } </script> </head> <body> <form id="form1" runat="server"> <asp:Button runat="server" ID="btnLogin" OnClientClick="javascript:return Validate()" Text="Login" /> </form> </body> </html>
Sunday, August 22, 2010
How to stop a asp.net button being postback to server
Attach an OnClientClick java script function with return inline. From the function return false based on your logic
Subscribe to:
Post Comments (Atom)
Azure Storage Account Types
Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...
-
Why we need asynchronous tasks? Execute a time consuming operations in parallel to the CLR thread which execute the request If you have ...
-
Demo: I was thinking a way to show images before actually uploading them to server. I would say to preview images using javascript. Obv...
No comments:
Post a Comment