Compartir a través de


CustomValidator Remarks

  Microsoft Speech Technologies Homepage

The CustomValidator control performs application-specific validation of data.

The SemanticItemToValidate property of the CustomValidator control references the SemanticItem containing the data to be validated. The CustomValidator is activated when this data is changed or confirmed, depending on the setting of the ValidationEvent property. The data to be validated is evaluated by the client-side script procedure specified in the ClientValidationFunction. If the script returns False, the data in the control is invalidated.

When the result of the comparison is False, the CustomValidator plays its Prompt to inform the user that the data is not valid.

When creating a Speech CustomValidator control to validate data collected by a QA control, ensure either that the validator immediately precedes the QA in the source code, or that the validator's SpeechIndex property follows than the SpeechIndex property of the QA. When the data is invalid, the dialog manager RunSpeech activates the validator to play a prompt message, and then reactivates the QA control. For more details, see Management of Speech Validator Controls and the RunSpeech Example.

The CustomValidator is similar in purpose to the CompareValidator control. The CustomValidator supports custom validation, and the CompareValidator supports validation with a fixed set of operators.

Markup

<speech:CustomValidator Properties runat="server" >

   <Prompt ... />

</speech:CustomValidator>

See Also

CustomValidator Class | CustomValidator Constructor | CustomValidator Members | CustomValidator Properties | CustomValidator Methods | CustomValidator Events