OnClientActive Property

  Microsoft Speech Technologies Homepage

Gets or sets the name of a client-side function that is called each time the QA control is activated, before it begins to execute. Read/write.

Usage

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

Remarks

RunSpeech calls the OnClientActive function each time it activates or reactivates the QA control, even when the QA control is already the current ActiveQA.

The value of the OnClientActive property is the name of a custom client-side script function, without parameters or parentheses. The client-side dialog manager calls this function, using the following syntax, after RunSpeech determines that this QA is active and before processing the QA (for example, playing a prompt or starting recognition).

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

function FunctionName ()
{
     // Client-side code referenced by QA.OnClientActive
}

Parameters

None.

Return Value

None.

Example

<script>
  function myClientActive() {
  // OnClientActive routine
  }
</script>

<form id="Form1" method="post" runat="server">
  ...
  <Speech:QA ID="CfmToppingSize" FirstInitialTimeout="1000" runat="server" 
       XPathAcceptConfirms="/SML/Accept" AcceptRejectThreshold=".9"
       XPathDenyConfirms="/SML/Deny"     DenyRejectThreshold=".9"
       OnClientActive="myClientActive" >
    <Prompt PromptSelectFunction="CfmToppingSizePrompt" BargeIn="False" ID="Prompt1"></Prompt>
    <Reco InitialTimeout="3000" BabbleTimeout="10000" EndSilence="1000" Reject="0.5" ID="Reco1">
      <Grammars>
        <Speech:Grammar Src="Grammars/CfmToppingSize.grxml" ID="Grammar1"></Speech:Grammar>
      </Grammars>
    </Reco>
    <Confirms>
      <Speech:Answer ConfirmThreshold="1" SemanticItem="siTopping" ID="Topping_QACfmToppingSize" XPathTrigger="/SML/Correction/Topping"></Speech:Answer>
      <Speech:Answer ConfirmThreshold="1" SemanticItem="siSize" ID="Size_QACfmToppingSize" XPathTrigger="/SML/Correction/Size"></Speech:Answer>
    </Confirms>
  </Speech:QA>
  ...
</form>

See Also

QA Class | QA Constructor | QA Members | QA Properties | QA Methods | QA Events | QA Remarks | QA Client Object