Working with TreeView WebControl (binding with XML)

Discussion in 'ASP .Net Web Controls' started by naija naija, Sep 3, 2004.

  1. naija naija

    naija naija Guest

    I have a treeview binded with a XML file and it was working.
    Later is stopped and SINCE then refused to work.
    I have TRIED EVERYTHING BUT STILL NOT WORKING!!
    Error:-
    System.Xml.XmlException: The data at the root level is invalid. Line 1,
    position 1.

    But if i paste:-
    <IEWC:TREENODE Text="Business Units"></IEWC:TREENODE>
    Directly without binding it with XML it works fine.!
    Can somebody really explain how this works!!

    CODE BELOW:-



    .aspx file
    -----------
    <IEWC:TREEVIEW id="TreeView1" runat="server"
    AutoSelect="True" SelectExpands="True">
    <IEWC:TREENODE TreeNodeSrc="IEWC.xml"
    Text="DEMO TREE" Expanded="True">
    </IEWC:TREENODE>
    </IEWC:TREEVIEW >

    .xml file(IEWC.xml)
    -----------
    <?xml version="1.0" encoding="utf-8" ?>
    <TREENODE>
    <TreeNode Text="Production">
    <TreeNode Text="Solution Architect">
    <TreeNode Text="Project Manager">
    <TreeNode Text="Project Leader">
    <TreeNode Text="Programmer"/>
    <TreeNode Text="Designer"/>
    </TreeNode>
    </TreeNode>
    </TreeNode>
    </TreeNode>
    <TreeNode Text="Marketing & Sales">
    <TreeNode Text="Business Development Manager">
    <TreeNode Text="Area Manager">
    <TreeNode Text="Area Sales Manager">
    <TreeNode Text="Sales Man"/>
    <TreeNode Text="Sales Women"/>
    </TreeNode>
    </TreeNode>
    </TreeNode>
    </TreeNode>
    </TREENODE>


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    naija naija, Sep 3, 2004
    #1
    1. Advertising

  2. naija naija

    Teemu Keiski Guest

    How do you pass the XML to the control?

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke


    "naija naija" <> wrote in message
    news:...
    > I have a treeview binded with a XML file and it was working.
    > Later is stopped and SINCE then refused to work.
    > I have TRIED EVERYTHING BUT STILL NOT WORKING!!
    > Error:-
    > System.Xml.XmlException: The data at the root level is invalid. Line 1,
    > position 1.
    >
    > But if i paste:-
    > <IEWC:TREENODE Text="Business Units"></IEWC:TREENODE>
    > Directly without binding it with XML it works fine.!
    > Can somebody really explain how this works!!
    >
    > CODE BELOW:-
    >
    >
    >
    > aspx file
    > -----------
    > <IEWC:TREEVIEW id="TreeView1" runat="server"
    > AutoSelect="True" SelectExpands="True">
    > <IEWC:TREENODE TreeNodeSrc="IEWC.xml"
    > Text="DEMO TREE" Expanded="True">
    > </IEWC:TREENODE>
    > </IEWC:TREEVIEW >
    >
    > .xml file(IEWC.xml)
    > -----------
    > <?xml version="1.0" encoding="utf-8" ?>
    > <TREENODE>
    > <TreeNode Text="Production">
    > <TreeNode Text="Solution Architect">
    > <TreeNode Text="Project Manager">
    > <TreeNode Text="Project Leader">
    > <TreeNode Text="Programmer"/>
    > <TreeNode Text="Designer"/>
    > </TreeNode>
    > </TreeNode>
    > </TreeNode>
    > </TreeNode>
    > <TreeNode Text="Marketing & Sales">
    > <TreeNode Text="Business Development Manager">
    > <TreeNode Text="Area Manager">
    > <TreeNode Text="Area Sales Manager">
    > <TreeNode Text="Sales Man"/>
    > <TreeNode Text="Sales Women"/>
    > </TreeNode>
    > </TreeNode>
    > </TreeNode>
    > </TreeNode>
    > </TREENODE>
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Teemu Keiski, Sep 3, 2004
    #2
    1. Advertising

  3. What i'm doing is trying to bind an XML file to a treeView Menu.
    The control is already installed on my PC and the code below is suppose
    to bind it to the MENU.

    Can you explain what u meant by how do i pass XML tot he control?

    Any help!!

    <IEWC:TREEVIEW id="TreeView1" runat="server"
    AutoSelect="True" SelectExpands="True">
    <IEWC:TREENODE TreeNodeSrc="IEWC.xml"
    Text="DEMO TREE" Expanded="True">
    </IEWC:TREENODE>
    </IEWC:TREEVIEW >



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    naijacoder naijacoder, Sep 4, 2004
    #3
  4. naija naija

    Teemu Keiski Guest

    Yup,

    that how you pass the XML for the TreeView control. Using which property?

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke


    "naijacoder naijacoder" <> wrote in message
    news:...
    > What i'm doing is trying to bind an XML file to a treeView Menu.
    > The control is already installed on my PC and the code below is suppose
    > to bind it to the MENU.
    >
    > Can you explain what u meant by how do i pass XML tot he control?
    >
    > Any help!!
    >
    > <IEWC:TREEVIEW id="TreeView1" runat="server"
    > AutoSelect="True" SelectExpands="True">
    > <IEWC:TREENODE TreeNodeSrc="IEWC.xml"
    > Text="DEMO TREE" Expanded="True">
    > </IEWC:TREENODE>
    > </IEWC:TREEVIEW >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Teemu Keiski, Sep 6, 2004
    #4
  5. Hi Teemu,
    I got it working and the PROBLEM wasn't the way i was passing the
    XML.It had a configuration problem with permissions/authentication with
    Anonymous access and stuff.(WHAT I DIDN'T EVEN THINK OFF).




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    naijacoder naijacoder, Sep 7, 2004
    #5
  6. naija naija

    Teemu Keiski Guest

    That's why I was asking to see that did you pass it with a file or plain
    string into the TreeVeiw control. But good that you got it solved.


    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke


    "naijacoder naijacoder" <> wrote in message
    news:...
    > Hi Teemu,
    > I got it working and the PROBLEM wasn't the way i was passing the
    > XML.It had a configuration problem with permissions/authentication with
    > Anonymous access and stuff.(WHAT I DIDN'T EVEN THINK OFF).
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Teemu Keiski, Sep 7, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    742
  2. Replies:
    0
    Views:
    412
  3. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    207
    Luis Ramírez
    Jul 6, 2004
  4. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    203
    Kasabaarde Sumta
    Dec 13, 2004
  5. Fabricio

    Custom webcontrol that references another webcontrol

    Fabricio, Sep 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    191
    Fabricio
    Sep 21, 2005
Loading...

Share This Page