Compartir a través de


QuestionPrompt Property for French (Canada)

  Microsoft Speech Technologies Homepage

Gets or sets the text of the initial question to be played by the control. Read/write.

Usage

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

Remarks

The QuestionPrompt property enables authors to customize the initial prompt of an Application Speech Control according to the needs of the application.

Example

The following example demonstrates the QuestionPrompt property that is used in a Phone Application Speech Control. This example is based on the Speech Application SDK Phone Number sample.

<script language="jscript">
  //formatting the area code part to look like: (NNN)
  function FormatAC(theValue){ 
    if(theValue == null) 
      return; 
    else { 
      var sAC = "(" + theValue.value + ")"; 
      document.all.tbPhone.value = sAC + document.all.tbPhone.value;
    } 
  } 
  //formatting the area code part to look like: NNN NNNN 
  function FormatLN(theValue){ 
    var sLN = theValue.value; 
    if(sLN == null || sLN.length != 7) 
      return;                 
    else {            
      var re = /(\d{3})(\d{4})/;                   
      var aMatchCollection = sLN.match(re);                     
      sLN = aMatchCollection[1] + " " + aMatchCollection[2]; 
      document.all.tbPhone.value = document.all.tbPhone.value + " " + sLN;                   
    } 
  } 
  //formatting the extension part to look like: xNNNN
  function FormatEXT(theValue){ 
    if(theValue.value == "") 
      return; 
    else { 
      var sEXT = "x" + theValue.value; 
      document.all.tbPhone.value = document.all.tbPhone.value + " " + sEXT;                     
    } 
  } 
</script>

<form id="formPhone" method="post" runat="server">
  ...
  <asp:textbox id="tbPhone" runat="server" borderstyle="Solid">
  </asp:textbox>
  <asp:panel ID="SpeechPanel" runat="server">
    <speech:SemanticMap runat="server">
      <speech:SemanticItem ID="siAC"  onclientconfirmed="FormatAC" runat="server">
      </speech:SemanticItem>
      <speech:SemanticItem ID="siLN"  onclientconfirmed="FormatLN" runat="server">
      </speech:SemanticItem>
      <speech:SemanticItem ID="siEXT" onclientconfirmed="FormatEXT" runat="server">
      </speech:SemanticItem>
    </speech:SemanticMap>

    <speech:Phone ID="PhoneQA" 
      QuestionPrompt="quel est votre numéro de téléphone?" 
      AreaCodeSemanticItem="siAC" 
      LocalNumberSemanticItem="siLN" 
      ExtensionSemanticItem="siEXT" 
      BabbleTimeout="10000" 
      FirstInitialTimeout="1000" 
      InitialTimeout="3000" 
      MaxTimeout="30000"
      RejectThreshold="0.2" 
      runat="server">
    </speech:Phone>

  </asp:panel>
  ...
</form>

See Also

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