Compartir a través de


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 Date control. Read/write.

Usage

ASP.NET markup: <speech:Date PromptSelectFunction="..." />
Get value: String = Date.PromptSelectFunction;
Set value: Date.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 Date.PromptSelectFunction
}

Parameters

  • control
    The Application Speech Control object.

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 Date object may be one of the following values:

  • questionDate
  • confirmDate
  • questionDay
  • confirmDay
  • questionMonth
  • confirmMonth
  • questionYear
  • confirmYear
  • validate
  • acknowledge

Example

<script language="jscript">
  function myPromptSelectFunction(obj)   {
    if (obj.ActiveQAPhase == "confirm") {
      return "This is the prompt for the confirm QA";
    }
    if (obj.ActiveQAPhase == "question") {
      return "This is the prompt for the question QA";
    }
  }
</script>
<form id="Form1" method="post" runat="server">
  ...
  <speech:semanticmap id="SemanticMap1" runat="server">
    <speech:SemanticItem ID="DaySemItem" TargetAttribute="value" 
      TargetElement="tbDay" runat="server">
    </speech:SemanticItem>
    <speech:SemanticItem ID="MonthSemItem" TargetAttribute="Text" 
      BindAt="server" TargetElement="tbMonth" runat="server">
    </speech:SemanticItem>
    <speech:SemanticItem ID="YearSemItem" TargetAttribute="value" 
      BindOnChanged="True" TargetElement="tbYear" runat="server">
    </speech:SemanticItem>
  </speech:semanticmap>

  <speech:date 
    id="Date1" 
    QuestionPrompt="quand est-ce que vous aimeriez voyager?" 
    PromptSelectFunction="myPromptSelectFunction"
    DateContext="Future"
    AllowHolidays="True"
    AllowNumeralDates="True"
    AllowRelativeDates="True"
    DaySemanticItem="DaySemItem" 
    MonthSemanticItem="MonthSemItem"
    YearSemanticItem="YearSemItem" 
    SpeechIndex="1000" 
    OnClientActive="MyClientActive"
    runat="server">
  </speech:date>

  <asp:textbox id="tbDay" runat="server"></asp:textbox>
  <asp:TextBox id="tbMonth" runat="server"></asp:TextBox>
  <asp:TextBox id="tbYear" runat="server"></asp:TextBox>
  ...
</form>

See Also

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