Compartir a través de


ValueToCompare Property

  Microsoft Speech Technologies Homepage

Gets or sets the value that is used as the basis for the compare operation. Read/write.

Usage

ASP.NET markup: <speech:CompareValidator ValueToCompare="..." />
Get value: String = CompareValidator.ValueToCompare;
Set value: CompareValidator.ValueToCompare = String;
Data type: String
Required: No

Remarks

Authors can use ValueToCompare to compare data with a literal value instead of with the value of a control on the page. The control throws the InvalidOperationException if ValueToCompare cannot be converted to a valid data type.

When the Operator of the validator is DataTypeCheck, ValueToCompare and SemanticItemToCompare are not used.

With all other values of the Operator property, ValueToCompare is optional, but either SemanticItemToCompare or ValueToCompare must be specified. If both are specified, SemanticItemToCompare takes precedence. The control throws the InvalidOperationException if neither of these properties is specified.

Example

<form ID="Form1" method="post" runat="server">
  ...
  <Speech:CompareValidator ID="TestV1" Type="Integer" runat="server" 
    SemanticItemToValidate="siValue1" Operator="GreaterThan" ValueToCompare="256" >
    <Prompt InlinePrompt="Value1 must be greater than 256"></Prompt>
  </Speech:CompareValidator>
  ...
</form>

See Also

CompareValidator Class | CompareValidator Constructor | CompareValidator Members | CompareValidator Properties | CompareValidator Methods | CompareValidator Events | CompareValidator Remarks