Share via


ApplicationControl.PromptSelectFunction Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

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

Namespace: Microsoft.Speech.Web.UI
Assembly: Microsoft.Speech.Web (in microsoft.speech.web.dll)

Syntax

'Declaration
<DefaultValueAttribute("")> _
<BindableAttribute(True)> _
<SRCategoryAttribute("Category_Speech")> _
<SRDescriptionAttribute("All_PromptSelectFunction")> _
Public Property PromptSelectFunction As String
[DefaultValueAttribute("")] 
[BindableAttribute(true)] 
[SRCategoryAttribute("Category_Speech")] 
[SRDescriptionAttribute("All_PromptSelectFunction")] 
public string PromptSelectFunction { get; set; }

Property 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.

Remarks

When Speech Server 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 Authoring Notes.

Example

The following example demonstrates the PromptSelectFunction property that is used in a ZipCodeApplication Speech Control.

<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:ZipCode id="ZipCode1" runat="server"
    QuestionPrompt="Please tell me your Zip Code" 
    ZipcodeSemanticItem="siZip" 
    ExtensionSemanticItem="siExt" 
    PromptSelectFunction="myPromptSelectFunction">
  </speech:ZipCode>

  <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
  <asp:TextBox id="TextBox2" runat="server"></asp:TextBox>

  <speech:SemanticMap id="SemanticMap1" runat="server">
      <speech:SemanticItem ID="siZip" BindOnChanged="True" runat="server" 
        TargetAttribute="TextBox1" TargetElement="value" >
     </speech:SemanticItem>
      <speech:SemanticItem ID="siExt" BindOnChanged="True" runat="server" 
        TargetAttribute="TextBox2" TargetElement="value" >
     </speech:SemanticItem>
  </speech:SemanticMap>
  ...
</form>

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Windows Server 2003

See Also

Reference

ApplicationControl Class
ApplicationControl Members
Microsoft.Speech.Web.UI Namespace