Condividi tramite


TargetElement Property

  Microsoft Speech Technologies Homepage

Gets or sets the client-side ID of the input control containing the value to be inserted into the Prompt. Read/write.

Usage

ASP.NET markup: <speech:Param TargetElement="..." />
Get value: String = Param.TargetElement;
Set value: Param.TargetElement = String;
Data type: String
Required: Yes

Remarks

The TargetElement property of the Basic Speech Controls Value control mirrors the targetelement attribute of the SALT value element.

Example

The following example demonstrates the TargetElement property.

<form id="Form1" method="post" runat="server">
  ...
  <asp:label runat=server>Destination City: </asp:label>
  <asp:textbox id="TextBox1" runat=server></asp:textbox>

  <speech:Prompt ID="Prompt1" AutoPostBack="True" BargeIn="False"  
    PreFetch="True" lang="en-US" runat="server">
    <InlineContent> What is your destination city? </InlineContent>
  </speech:Prompt>

  <speech:Listen id="Listen1" runat="server"
    BabbleTimeout="2000" MaxTimeout="5000" Reject="0.2">
    <bindings>
      <speech:bind TargetElement="txtDest" TargetAttribute="value" 
        value="./City" runat="server"/>
    </bindings>
    <grammars>
      <speech:grammar runat="server" 
        src="Grammars/CityGrammar.grxml" ID="Grammar1" />
    </grammars>
  </speech:Listen>

  <speech:Prompt ID="Prompt2" AutoPostBack="True" BargeIn="False"  
    PreFetch="True" lang="en-US" runat="server">

    <InlineContent> 
      Did you say 
      <speech:Value TargetElement="TextBox1" TargetAttribute="value" >
      </speech:Value>
      ? 
    </InlineContent>

  </speech:Prompt>
  ...
</form>

See Also

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