| Author: Siddesh Kapadi 04 Jul 2008 | Member Level: Silver | Rating: Points: 2 |
This is possible using a custom javascript. As the validation are done using the javascript. So server side transfer is not possible.
|
| Author: arun kumar 04 Jul 2008 | Member Level: Silver | Rating: Points: 6 |
<head runat="server"> <script language="javascript" type="text/javascript"> function Check() { if (document.form1.Textbox1.value!=document.form1.Textbox2.value) { document.form1.Textbox1.value=""; document.form1.Textbox2.value=""; return false; } } </script> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:textbox ID="Textbox1" runat="server"></asp:textbox> <asp:textbox ID="Textbox2" runat="server"></asp:textbox> <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return Check()" /> <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="CompareValidator" ControlToCompare="Textbox1" ControlToValidate="Textbox2" OnLoad="CompareValidator1_Load"></asp:CompareValidator> </div> </form> </body>
|