Click here to Skip to main content
15,041,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am unable to get original data on webpage for treeview.
xml file:
  <genre name="fiction">
    <book isbn="10-000000-001">
      <title>The Iliad and The Odyssey</title>
        <usercomment rating="4">
          Best translation I've read.
        <usercomment rating="2">
          I like other versions better.
    <book isbn="10-000000-999">
      <title>Anthology of World Literature</title>
        <usercomment rating="3">
          Needs more modern literature.
        <usercomment rating="4">
          Excellent overview of world literature.
  <genre name="nonfiction">
    <book isbn="11-000000-002">
      <title>Computer Dictionary</title>
        <usercomment rating="3">A valuable resource.</usercomment>
    <book isbn="11-000000-003">
      <title>Cooking on a Budget</title>
        <usercomment rating="4">Delicious!</usercomment>

<asp:TreeView ID="TreeView1" runat="server" AutoGenerateDataBindings="False"
        <asp:TreeNodeBinding DataMember="BookStore" Text="Book Information"
            Value="Book Information" />
        <asp:TreeNodeBinding DataMember="genre" Text="Name" Value="Name" />
        <asp:TreeNodeBinding DataMember="Book" Text="ISBN" Value="ISBN" />

<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/sample.xml">

I am getting only nodes,but i need the original data in xml file.

Thanking you all.
Updated 2-Nov-11 19:41pm

1 solution

Hi Srinivas

I think you need to specify XPth in XML datasource by setting xpath="BookStore/*"
or the value you required to display.

I hope this helps
Do let me know if you need any further details.

Thanks & Regards,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900