Partilhar via


SemanticItemToCompare Property

  Microsoft Speech Technologies Homepage

Gets or sets the ID of the SemanticItem control that is used as the basis for the compare operation. Read/write.

Usage

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

Remarks

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

With all other values of the Operator property, SemanticItemToCompare 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, or the ArgumentNullException if SemanticItemToCompare is invalid.

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>

  <Speech:CompareValidator ID="TestV2" Type="Integer" runat="server" 
    SemanticItemToValidate="siValue2" Operator="GreaterThan" SemanticItemToCompare="siValue1" >
    <Prompt InlinePrompt="Value2 must be greater than Value1"></Prompt>
  </Speech:CompareValidator>
  ...
</form>

See Also

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