Go to DotNetFunda.com
 Online : 1032 |  Welcome, Guest!   Login
 
<<= Please see left side tutorials menu.

  • Download the OOPS, ASP.NET and ADO.NET Training Videos for FREE, click here.


Silverlight Tutorials | Report a Bug in the Tutorial

Interesting?   Share and Bookmark this

asp:XmlDataSource control
The XmlDataSource control is a unique data source control that support both tabular and hierarchical views of data.
 
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.

Some Important Properties of XmlDataSource Control
Data Gets or sets the blcok of XML contents text to bind to the target control.
DataFile XML File path used to display bind data to target controls.
XPath Gets an XPath query to apply on XML data.
Transform Block of XSLT text that is used to transform data.
TransformFile XSL File path that defines the transformation to be applied on XML file.
EnableCaching true/false. Whether to enable caching or not.
CacheDuration Number of seconds, data to be maintained in the cache.
CacheExpirationPolicy Absolute/Sliding. Cache policy to be applied on.
Absolute: The data is removed after specified duration. Sliding: The data is removed if it is not used for specified duration.
DEMO : ObjectDataSource Show Source Code
Skip Navigation Links. For more on XML see XML Control
                    
                    
// 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>


                    




About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)