ASP.NET(vb.net) & CompareValidator - asp:CompareValidator : Compares the value entered by the user in an input control with the value entered in another input control, or with a constant value.
ShotDev Focus:
- ASP.NET(vb.net) & CompareValidator
Tag Control
<asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="CompareValidator"></asp:CompareValidator>
Example
CompareValidator.aspx
<%@ Page Language="VB" %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <form id="form1" runat="server"> Password<br /> <asp:TextBox id="txtPassword" TextMode="Password" runat="server"></asp:TextBox><br /> ConfirmPassword<br /> <asp:TextBox id="txtConfirmPassword" TextMode="Password" runat="server"></asp:TextBox> <asp:CompareValidator id="myCompareValidator" runat="server" ControlToCompare="txtPassword" ControlToValidate="txtConfirmPassword" ErrorMessage="Password not Match"></asp:CompareValidator><br /> <asp:Button id="btnSubmit" runat="server" Text="Submit" /> </form> </body> </html>
Screenshot