Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Getting Values [modified]

Getting Values [modified]

Scheduled Pinned Locked Moved XML / XSL
htmldatabasesysadminxmlquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sriharsha_12
    wrote on last edited by
    #1

    Hi all...i'm new to xml...i'm displaying values from xml file to html using the below code... HTML FILE

    <form id="form1" runat="server">
                <div>
                      <asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1">
                            <DataBindings>
                                  <asp:TreeNodeBinding DataMember="Product" ValueField="ID" TextField="Name"></asp:TreeNodeBinding>
                                  <asp:TreeNodeBinding DataMember="Desc" ValueField="Value" TextField="Value"></asp:TreeNodeBinding>
                            </DataBindings>
                      </asp:TreeView>
                      <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XML/XmlFile_1.xml">
                      </asp:XmlDataSource>
                </div>
          </form>

    XML FILE:

    <?xml version="1.0" encoding="utf-8" ?>
    <!-- This file represents a fragment of Product
             store inventory database -->
    <Products>
       <Product ID="1" Name="a" Price="5">
          <Desc Value="5 boxes x 50 Bags"/>
       </Product>
       <Product ID="2" Name="b" Price="10">
          <Desc Value="24oz bottles"/>
       </Product>
       <Product ID="3" Name="c" Price="15">
          <Desc Value="40 kg pkgs"/>
       </Product>
    </Products>

    Now i wanna use a text

    L 1 Reply Last reply
    0
    • S sriharsha_12

      Hi all...i'm new to xml...i'm displaying values from xml file to html using the below code... HTML FILE

      <form id="form1" runat="server">
                  <div>
                        <asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1">
                              <DataBindings>
                                    <asp:TreeNodeBinding DataMember="Product" ValueField="ID" TextField="Name"></asp:TreeNodeBinding>
                                    <asp:TreeNodeBinding DataMember="Desc" ValueField="Value" TextField="Value"></asp:TreeNodeBinding>
                              </DataBindings>
                        </asp:TreeView>
                        <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XML/XmlFile_1.xml">
                        </asp:XmlDataSource>
                  </div>
            </form>

      XML FILE:

      <?xml version="1.0" encoding="utf-8" ?>
      <!-- This file represents a fragment of Product
               store inventory database -->
      <Products>
         <Product ID="1" Name="a" Price="5">
            <Desc Value="5 boxes x 50 Bags"/>
         </Product>
         <Product ID="2" Name="b" Price="10">
            <Desc Value="24oz bottles"/>
         </Product>
         <Product ID="3" Name="c" Price="15">
            <Desc Value="40 kg pkgs"/>
         </Product>
      </Products>

      Now i wanna use a text

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Did you look at any of this before or after you posted it?

      S 1 Reply Last reply
      0
      • L Lost User

        Did you look at any of this before or after you posted it?

        S Offline
        S Offline
        sriharsha_12
        wrote on last edited by
        #3

        i searched, but i didt get anything...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups