<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHeader" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderForTitleAndIntro" Runat="Server">
<table width="100%" cellpadding="2" cellspacing="0">
<tr valign="top" class="ArticleTitle">
<td style="padding-left:10px;" valign="middle">
asp:XmlDataSource control</td>
</tr>
<tr>
<td class="ArticleContents">
The XmlDataSource control is a unique data source control that support both tabular and hierarchical views of data.
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderForContents" Runat="Server">
<div class="ArticleContents">
The XmlDataSource control is a unique data source control that support both tabular and hierarchical views of data.
Unlike other DataSource Control, this control only support read-only methods.
<br /><br />
<table width="100%" class="TutoPropPlaceHolder" border="1" cellpadding="2" cellspacing="1">
<tr>
<th colspan="2" align="left">
Some Important Properties of XmlDataSource Control
</th>
</tr>
<tr>
<td class="DemoCP">Data</td>
<td>
Gets or sets the blcok of XML contents text to bind to the target control.
</td>
</tr>
<tr>
<td class="DemoCP">DataFile</td>
<td>
XML File path used to display bind data to target controls.
</td>
</tr>
<tr>
<td class="DemoCP">XPath</td>
<td>
Gets an XPath query to apply on XML data.
</td>
</tr>
<tr>
<td class="DemoCP">Transform</td>
<td>
Block of XSLT text that is used to transform data.
</td>
</tr>
<tr>
<td class="DemoCP">TransformFile</td>
<td>
XSL File path that defines the transformation to be applied on XML file.
</td>
</tr>
<tr>
<td class="DemoCP">EnableCaching</td>
<td>
true/false. Whether to enable caching or not.
</td>
</tr>
<tr>
<td class="DemoCP">CacheDuration</td>
<td>
Number of seconds, data to be maintained in the cache.
</td>
</tr>
<tr>
<td class="DemoCP">CacheExpirationPolicy</td>
<td>
Absolute/Sliding. Cache policy to be applied on. <br />
Absolute: The data is removed after specified duration. Sliding: The data is removed if it is not used for specified duration.
</td>
</tr>
</table>
<!-- START - Demo Section -->
<table class="DemoPlaceHolder" border="1" cellpadding="2" cellspacing="4">
<tr>
<td class="DemoTitle">
DEMO : ObjectDataSource
</td>
<td align="right">
<a class="DemoShowSource" href="../../misc/codeviewer/default.aspx?pagename=~/tutorials/controls/xmldatasource.aspx" target="_blank">Show Source Code</a>
</td>
</tr>
<tr>
<td>
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1">
<DataBindings>
<asp:TreeNodeBinding TextField="#innertext" DataMember="Name" />
<asp:TreeNodeBinding TextField="#innertext" DataMember="From" />
</DataBindings>
</asp:TreeView>
<asp:XmlDataSource ID="XmlDataSource1" runat="Server" DataFile="~/tutorials/controls/controldata/XMLFile.xml"
XPath="DotNetFunda/Writers">
</asp:XmlDataSource>
</td>
<td>
For more on XML see <a href="xml.aspx">XML Control</a>
</td>
</tr>
<tr>
<td colspan="2">
<!-- START - Server Side Code -->
<pre>
// TreeView Control ///////////////////////////////
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1">
<DataBindings>
<asp:TreeNodeBinding TextField="#innertext" DataMember="Name" />
<asp:TreeNodeBinding TextField="#innertext" DataMember="From" />
</DataBindings>
</asp:TreeView>
// XmlDataSource Control ///////////////////////////////
<asp:XmlDataSource ID="XmlDataSource1" runat="Server" DataFile="~/tutorials/controls/controldata/XMLFile.xml"
XPath="DotNetFunda/Writers">
</asp:XmlDataSource>
// XML File ///////////////////////////////
<DotNetFunda>
<Writers>
<Name>Sheo Narayan</Name>
<From>Hyderabad, India</From>
</Writers>
<Writers>
<Name>Vijay Bandaru</Name>
<From>Virginia, USA</From>
</Writers>
<Writers>
<Name>Jay Shankar</Name>
<From>Aurangabad, India</From>
</Writers>
<Writers>
<Name>Dr. Sunita Narayan</Name>
<From>Bokaro, India</From>
</Writers>
<Writers>
<Name>Sunil Kumar Prasad</Name>
<From>Ranchi, India</From>
</Writers>
<Writers>
<Name>Sunita Shankar</Name>
<From>Daudnagar, India</From>
</Writers>
</DotNetFunda>
</pre>
<!-- END - Server Side Code -->
</td>
</tr>
</table>
<!-- END - Demo Section -->
</div>
<br />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderFooter" Runat="Server">
</asp:Content>
Go Top