Partager via


PromptSelectFunction Property for French (Canada)

  Microsoft Speech Technologies Homepage

Gets or sets the name of a client-side routine that specifies prompt text for the DataTableNavigator control. Read/write.

Usage

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

Remarks

When the Speech Platform plays the prompt, it attempts to use recorded text from a PromptDatabase, and synthesizes the text if recorded text is not found.

The value of the PromptSelectFunction 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 the control has been activated and before the prompt playback begins.

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 ( object control )
{
// Client-side code referenced by DataTableNavigator.PromptSelectFunction
}

Parameters

  • control
    The Application Speech Control object.
    In the DataTableNavigator control, the Command/Exception History can also contain the following additional values:
    • NVG_previousOnFirstError, when trying to get an item before the first one
    • NVG_nextOnLastError, when trying to get an item after the last one
    • NVG_onlyItemError, This error message replaces NVG_previousOnFirstError and NVG_nextOnLastError when there is only one item in the datasource.
    • NVG_headers, when requested to read the headers
    • NVG_contents, when requested to read the contents
    • NVG_column, when requested to read a specific column name. The name of the column to read is put in the Arg property of the clientControl object that is passed to the PromptSelectFunction associated with this control.

Return Value

A string containing the prompt text to be played, or a null string. If the function returns a null string, the inline prompt is played. Application Speech Controls contain built-in prompts for question, confirm, silence, noreco and help. The default behavior is to play the silence, noreco or help prompt, if appropriate, followed by the question or confirm prompt.

ActiveQAPhase values

The ActiveQAPhase property of the client-side DataTableNavigator object may be one of the following values:

  • question
  • confirm
  • acknowledge

Example

<script language="jscript">
  function myPromptSelectFunction(obj)   {
    if (obj.ActiveQAPhase == "question") {
      return "This is the prompt for the question QA";
    }
  }
</script>
<form id="Form1" method="post" runat="server">
  ...
  <asp:textbox id="TextBox1" runat="server"></asp:textbox>
  <speech:semanticmap id="SemanticMap1" runat="server" >
    <speech:SemanticItem id="SemItemNav" runat="server" 
      TargetElement="TextBox1" TargetAttribute="value" BindOnChanged="True">
    </speech:SemanticItem>
  </speech:semanticmap>

  <speech:DataTableNavigator 
    id="Navigator1"  
    QuestionPrompt="météo par état" 
    PromptSelectFunction="myPromptSelectFunction"
    DataHeaderFields="ville,état"
    DataContentFields="minimum,maximum,conditions" 
    EndSilence="2500" 
    AccessMode="Select" 
    ShortInitialTimeout="2000" 
    SemanticItem="SemItemNav"
    runat="server">
  </speech:DataTableNavigator>
  ...
</form>

See Also

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