| |||||
XmlDataSource Control SyntaxASP.NET Syntax ASP.NET Syntax for Web Controls Represents an XML data source to data-bound controls. For information on the individual members of this class, see XmlDataSource in the class library. RemarksThe XmlDataSource control is a data source control that represents XML data to data-bound controls. Because the XmlDataSource control extends the HierarchicalDataSourceControl class, and implements the IDataSource interface as well, the control can be used by data-bound controls to display both hierarchical and tabular, or list-style, data. The XmlDataSource control is typically used to display data in read-only scenarios. Syntax ExampleThe following example demonstrates how to bind a TreeView control to an XmlDataSource control with XML data that is defined using the Data property. <asp:treeview id="booktreeview" datasourceid="books" runat="server">
<databindings>
<asp:treenodebinding datamember = "book" textfield = "title" />
<asp:treenodebinding datamember = "chapter" textfield = "heading" />
<asp:treenodebinding datamember = "section" textfield = "heading" />
</databindings>
</asp:treeview>
<asp:xmldatasource id="books" runat="server">
<data>
<book title = "book title">
<chapter heading = "Chapter 1">
<section heading = "Section 1" />
<section heading = "Section 2" />
</chapter>
<chapter heading = "Chapter 2">
<section heading = "Section 1" />
</chapter>
</book>
</data>
</asp:xmldatasource>
See AlsoXmlDataSource Class XmlDataSource Web Server Control |
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme