Working with TreeView WebControl (binding with XML)

N

naija naija

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>
 
N

naijacoder naijacoder

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 >
 
T

Teemu Keiski

Yup,

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

naijacoder naijacoder

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).
 
T

Teemu Keiski

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top