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 {
   get,
   set
}

Remarks

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

Example

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" 
      OnClick="OnCmdClick1"/>
</mobile:Form>   

See Also

Applies to: CompareValidator Class

Show: