Compartir a través de


DataTableNavigator Example for French (Canada)

  Microsoft Speech Technologies Homepage

The following code example is based on the Navigating Tabular Data sample that is installed with the SASDK. The data schema used in this example is like the schema in the Navigating Tabular Data sample, but has an additional field called "CityNickname", which was added to demonstrate the use of fields with pipe-separated elements.

    <CityInfo>
        <City>New York</City>
        <CityNickname>New York|the big apple</CityNickname>
        <State>New York</State>
        <Conditions>Cloudy</Conditions>
        <High>80</High>
        <Low>50</Low>
        <Entertainment>Broadway shows</Entertainment>
    </CityInfo>
    <%@ Register TagPrefix="speech" Namespace="Microsoft.Speech.Web.UI" Assembly="Microsoft.Speech.Web, Version=1.0.3200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    <%@ Page language="c#" Codebehind="Page1.aspx.cs" AutoEventWireup="false" Inherits="Samples.TableNavigation.Page1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
      <HEAD>
        <title>Navigating Tabular Data</title> 
        <!--
_**************************************************************_
**Copyright (c) Microsoft Corporation.  All rights reserved.**
_**************************************************************_
    -->
        <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
        <meta content="C#" name="CODE_LANGUAGE">
        <meta content="JavaScript" name="vs_defaultClientScript">
        <meta content="https://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
      </HEAD>
      <body xmlns:speech="https://schemas.microsoft.com/speech/WebControls">
        <!-- #Include virtual="../DoNotRunInIE.inc" -->
        <script language="javascript" src="PromptHelper.js"></script>
        <form id="WebForm1" method="post" runat="server">
          <speech:semanticmap id="TheSemanticMap" runat="server">
            <speech:semanticitem id="siDataTableNavigator" runat="server"></speech:semanticitem>
          </speech:semanticmap>
          <br>
          <!-- The AnswerCall control is first in the evaluation order, and is responsible for answering the call to the application -->
          <speech:answercall id="AnswerCall1" runat="server"></speech:answercall>
          
          <speech:DataTableNavigator 
            id="Navigator1" 
            runat="server" 
            InitialTimeout="3000" MaxTimeout="30000" ShortInitialTimeout="500"
            AccessMode="Select"
            DataSource="<%# dataSet11 %>" 
            DataMember="CityInfo" 
            DataHeaderFields="ville,CityNickname,état"
            DataContentFields="maximum,minimum,conditions,divertissement" 
            DataTextField="CityNickname"
            DataBindField="State"
            QuestionPrompt="next command please" 
            PromptSelectFunction="promptSelectFunction" 
            SemanticItem="siDataTableNavigator">
            <HeaderTemplate>
              le temps maintenant dans 
              <%# DataBinder.Eval(Container.DataItem, "City")%>,
              <%# DataBinder.Eval(Container.DataItem, "State")%>
            </HeaderTemplate>
            <ContentTemplate>
              aujourd'hui dans <%# DataBinder.Eval(Container.DataItem, "City")%>
              <%# DataBinder.Eval(Container.DataItem, "Conditions")%>,
               avec un maximum de <%# DataBinder.Eval(Container.DataItem, "High")%>
               et un minimum de <%# DataBinder.Eval(Container.DataItem, "Low")%>
              non.
            </ContentTemplate>
            <Columns>
              <speech:ColumnTemplate Name="High">
                <ContentTemplate>
                  aujourd'hui dans &lt;%# DataBinder.Eval(Container.DataItem, "City")%&gt;
                  un maximum de &lt;%# DataBinder.Eval(Container.DataItem, "High")%&gt;
                  degrés.
                </ContentTemplate>
              </speech:ColumnTemplate>
              <speech:ColumnTemplate Name="Low" runat="server">
                <ContentTemplate>
                  aujourd'hui dans &lt;%# DataBinder.Eval(Container.DataItem, "City")%&gt;
                  un minimum de &lt;%# DataBinder.Eval(Container.DataItem, "Low")%&gt;
                  degrés.
                </ContentTemplate>
              </speech:ColumnTemplate>
            </Columns>
            <CommandRules>
              <speech:CommandRule Type="First"></speech:CommandRule>
              <speech:CommandRule Type="Last"></speech:CommandRule>
              <speech:CommandRule Type="Exit"></speech:CommandRule>
              <speech:CommandRule Type="Next"></speech:CommandRule>
              <speech:CommandRule Type="Previous"></speech:CommandRule>
              <speech:CommandRule Type="Select" Active="False"></speech:CommandRule>
              <speech:CommandRule Type="Header" Active="False"></speech:CommandRule>
              <speech:CommandRule Type="Read"></speech:CommandRule>
            </CommandRules>
          </speech:DataTableNavigator>
    
          <speech:qa id="Bye" runat="server" AllowCommands="False" PlayOnce="True">
            <Prompt PromptSelectFunction="myTest"></Prompt>
          </speech:qa>
          <br>
    
          <!-- The DisconnectCall control is last in the evaluation order, and is responsible for disconnecting the call to the application -->
          <speech:disconnectcall id="DisconnectCall1" runat="server"></speech:disconnectcall>
        </form>
        <script>
          function myTest (){
            return "The semantic item contains the word " + siDataTableNavigator.value;
          }
        </script>
      </body>
    </HTML>

See Also

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