Compartir a través de


DataMember Property for French (Canada)

  Microsoft Speech Technologies Homepage

Gets or sets a data member from a multimember DataSource object. Read/write.

Usage

ASP.NET markup: <speech:ListSelector DataMember="..." />
Get value: String = ListSelector.DataMember;
Set value: ListSelector.DataMember = String;
Data type: String
Required: No; Default: Null

Remarks

Use the DataMember property to specify a member from a multimember data source to bind to the list control. For example, if the DataSource property specifies a data source with more than one table, use the DataMember property to specify the table. For more information about ASP.NET data binding, see Accessing Data with ASP.NET.

The resolved data source (DataSource and DataMember) must be of one of the following types:

  • An array
  • An implementer of IList, provided the implementer has a strongly typed Item property (that is, if the Type is not Object). To accomplish this, make the default implementation of Item private. To create an IList that follows the rules of a strongly typed collection, derive from CollectionBase.
  • An implementer of ITypedList.

For more information, see the section titled Generic Collection Types in the .NET Framework Developer's Guide.

Example

<form id="Form1" method="post" runat="server">
  ...
  <speech:semanticmap ID="SemanticMap1" runat="server">
      <speech:SemanticItem ID="SemanticItem1" runat="server" >
      </speech:SemanticItem>
  </speech:semanticmap>

  <speech:ListSelector ID=ListSelector1 runat="server"
    SemanticItem="SemanticItem1" 
    QuestionPrompt="a quel employé voulez-vous parler?"  
    DataSource="<%# Employees %>"
    DataMember="<%# EmpPhones %>" 
    <GrammarTemplate>
        <%# DataBinder.Eval(Container.DataItem, "FirstName") %>
        | 
        <%# DataBinder.Eval(Container.DataItem, "LastName") %>
        | 
        <%# DataBinder.Eval(Container.DataItem, "FirstName") %> 
        <%# DataBinder.Eval(Container.DataItem, "LastName") %>
    </GrammarTemplate>
    FirstInitialTimeout="0">
  </speech:ListSelector>
  ...
</form>

See Also

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