Validating User Input against the Value in Another Control Using the CompareValidator Control (VB.net) : CompareValidator « Validation by Control « ASP.Net






Validating User Input against the Value in Another Control Using the CompareValidator Control (VB.net)

<%@ Page Language=VB Debug=true %>
<HTML>
<HEAD>
<TITLE>Validating User Input against the Value in Another Control Using the CompareValidator Control</TITLE>
</HEAD>
<form runat="server">
<BR><BR>
Enter the same value in both TextBox controls:
<BR>
<asp:textbox 
    id="txtSame1" 
    runat=server 
/>
<BR>
<asp:textbox 
    id="txtSame2" 
    runat=server 
/>
<asp:comparevalidator 
    id="cvCheckValues"
    controltovalidate="txtSame1" 
    controltocompare="txtSame2"
    runat=server
>
    <BR>Please enter the same value in both boxes.
</asp:comparevalidator>
<BR><BR>
<asp:button 
    id="butOK"
    text="OK"
    type="Submit"
    runat="server"
/>
</form>
</BODY>
</HTML>
           
       








Related examples in the same category

1.Validating User Input Against a Value Through the CompareValidator Control (VB.net)
2.Comparevalidator: equal (VB.net)
3.asp:CompareValidator Demo (VB.net)
4.Set CompareValidator to Today