This documentation is archived and is not being maintained.

ValueToCompare Property

.NET Framework 1.1

Sets or returns the value to compare.

public string ValueToCompare {


If both the ValueToCompare and ControlToCompare properties are present, the value of the ControlToCompare property is used.


The following example demonstrates how to use the ValueToCompare property to compare the string "guest" with what the user entered.

<mobile:Form runat=server id="Form1" >
   <mobile:Textbox  runat="server" id="txtUserName"/>
   <mobile:Textbox  runat="server" id="txtUserPwd" Password=True/>
   <Mobile:CompareValidator runat=server id=valcmprPassword 
      ControlToValidate="txtUserPwd" ValueToCompare="guest" Type = String
      Operator=Equal ErrorMessage="Please Enter default password guest" />
   <mobile:Command runat="server" id="Command1" text="Submit" 

See Also

Applies to: CompareValidator Class