OnClientError Property
Gets or sets the name of a client-side function that is called when client errors are detected. Read/write.
Usage
ASP.NET markup: | <speech:RecordSound OnClientError="..." /> |
Get value: | String = RecordSound.OnClientError; |
Set value: | RecordSound.OnClientError = String; |
Data type: | String |
Required: | No |
Remarks
The purpose of this routine is to examine the error code and to determine whether the RunSpeech dialog manager should continue execution on the current page or should navigate to the default error page. Different types of errors are distinguished by status codes. See the onerror and onnoreco events of the SALT listen element for a list of these codes.
The value of the OnClientError property is the name of this custom client-side script function, without parameters or parentheses. The client-side dialog manager calls this function, using the following syntax, after detecting recognition errors.
The script block that contains this function should be placed before the control that calls the function. For more information, see "Placement of Script Blocks" in Authoring Notes.
Syntax
bool FunctionName ( int status )
{
// Client-side code referenced by RecordSound.OnClientError
}
Parameters
- status
The error code returned in the event object.
Return Value
This value is True if the dialog manager should continue on the same page, and False if it should navigate to the default error page.
Example
<script>
function myClientError(obj) {
// OnClientError routine
return true;
}
</script>
<speech:RecordSound runat="server"
ID="RecordSound1"
Beep="True"
Type="audio/wav"
InitialTimeout="2500"
BabbleTimeout="2500"
MaxTimeout="5000"
SavePartialRecord="False"
PlaybackUrlBase="http://www.cpandl.com/playback/"
SavePath="d:\vdirs\playback"
Enabled="True"
OnClientError="myClientError"
>
</speech:RecordSound>
See Also
RecordSound Class | RecordSound Constructor | RecordSound Members | RecordSound Properties | RecordSound Methods | RecordSound Events | RecordSound Remarks