DataTableNavigator.ContentTemplate 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 the template that defines how the contents are played. Read/write.
Namespace: Microsoft.Speech.Web.UI
Assembly: Microsoft.Speech.Web (in microsoft.speech.web.dll)
Syntax
'Declaration
<SRDescriptionAttribute("DataTableNavigator_ContentTemplate")> _
<PersistenceModeAttribute(PersistenceMode.InnerProperty)> _
<TemplateContainerAttribute(GetType(DataItemContainer))> _
<BrowsableAttribute(False)> _
<DefaultValueAttribute(Nothing)> _
Public Property ContentTemplate As ITemplate
[SRDescriptionAttribute("DataTableNavigator_ContentTemplate")]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[TemplateContainerAttribute(typeof(DataItemContainer))]
[BrowsableAttribute(false)]
[DefaultValueAttribute(null)]
public ITemplate ContentTemplate { get; set; }
Remarks
The default behavior of the DataTableNavigator with regard to content fields is to speak the data in each specified content field. The ContentTemplate property enables application authors to customize the speaking of the content fields with additional text.
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.
Example
In the following example, the ContentTemplate property causes the control to speak the content fields as "cloudy, with a high of seventy and a low of fifty degrees" rather than as "cloudy, seventy, fifty."
<form id="Form1" method="post" runat="server">
...
<asp:textbox id="TextBox1" runat="server"></asp:textbox>
<speech:semanticmap id="SemanticMap1" runat="server" >
<speech:SemanticItem id="SemItemNav" runat="server"
TargetElement="TextBox1" TargetAttribute="value" BindOnChanged="True">
</speech:SemanticItem>
</speech:semanticmap>
<speech:DataTableNavigator
id="Navigator1"
QuestionPrompt="weather by city and state"
DataHeaderFields="City,State"
DataContentFields="Conditions,High,Low"
EndSilence="2500" ShortInitialTimeout="2000"
AccessMode="Select"
SemanticItem="SemItemNav"
runat="server">
<HeaderTemplate>
current weather conditions in
{OPEN_ASP_TAG}# DataBinder.Eval(Container.DataItem, "City"){CLOSE_ASP_TAG},
{OPEN_ASP_TAG}# DataBinder.Eval(Container.DataItem, "State"){CLOSE_ASP_TAG}
</HeaderTemplate>
<ContentTemplate>
{OPEN_ASP_TAG}# DataBinder.Eval(Container.DataItem, "Conditions"){CLOSE_ASP_TAG},
with a high of {OPEN_ASP_TAG}# DataBinder.Eval(Container.DataItem, "High"){CLOSE_ASP_TAG}
and a low of {OPEN_ASP_TAG}# DataBinder.Eval(Container.DataItem, "Low"){CLOSE_ASP_TAG} degrees
</ContentTemplate>
</speech:DataTableNavigator>
...
</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
DataTableNavigator Class
DataTableNavigator Members
Microsoft.Speech.Web.UI Namespace