Using Inline XML Data in an XmlDataSource Control : XmlDataSource « XML « ASP.Net

Home
ASP.Net
1.ADO.net Database
2.Ajax
3.Asp Control
4.Collections
5.Components
6.Data Binding
7.Development
8.File Directory
9.HTML Control
10.Language Basics
11.Login Security
12.Mobile Control
13.Network
14.Page
15.Request
16.Response
17.Server
18.Session Cookie
19.Sitemap
20.Theme Style
21.User Control and Master Page
22.Validation by Control
23.Validation by Function
24.WebPart
25.WPF
26.XML
ASP.Net » XML » XmlDataSource 
Using Inline XML Data in an XmlDataSource Control

<%@ Page Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Using Inline XML Data in an XmlDataSource Control</title>
</head>
<body>    
    <form id="form1" runat="server">
    <div>
        <asp:TreeView ID="bookView" Runat="server" DataSourceID="bookSource">
            <DataBindings>
                <asp:TreeNodeBinding ImageUrl="~/Images/openbook.gif" TextField="Title" DataMember="book"></asp:TreeNodeBinding>
                <asp:TreeNodeBinding ImageUrl="~/Images/notepad.gif" TextField="name" DataMember="chapter"></asp:TreeNodeBinding>
            </DataBindings>
        </asp:TreeView>    
    </div>
        <div>
            <asp:XmlDataSource ID="bookSource" Runat="server" XPath="Data/book">
                                 
<Data>
  <genre name="Fiction">
    <book ISBN="1" Title="title 1" Price="19.99" Discount="1.999">
      <chapter num="1" name="Introduction">
        Abstract...
      </chapter>
      <chapter num="2" name="Body">
        Abstract...
      </chapter>
      <chapter num="3" name="Conclusion">
        Abstract...
      </chapter>
    </book>
  </genre>


                </Data>
            </asp:XmlDataSource>
        </div>
    </form>
</html>

 
Related examples in the same category
1.asp:Xml datasource
2.Caching XML Data in an XmlDataSource Control
3.Create asp XmlDataSource
4.Binding XML Data from an XmlDataSource Control
5.Binding XML Data from Other Sources
6.Updating Data through XmlDataSource Control
7.Programmatically Creating an XmlDataSource Control
8.Handling XmlDataSource Events
9.Fill XmlDataSource with your code
10.XmlDataSource and XML document
11.Use ItemTemplate and XPath to display data from XmlDataSource
12.Using the XmlDataSource control to consume an RSS feed
13.Enter an XML filename or raw XML starting with
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.