Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Working with TreeView WebControl (binding with XML)

Reply
Thread Tools

Working with TreeView WebControl (binding with XML)

 
 
naija naija
Guest
Posts: n/a
 
      09-03-2004
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!
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      09-03-2004
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!



 
Reply With Quote
 
 
 
 
naijacoder naijacoder
Guest
Posts: n/a
 
      09-04-2004
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!
 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      09-06-2004
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!



 
Reply With Quote
 
naijacoder naijacoder
Guest
Posts: n/a
 
      09-06-2004
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!
 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      09-07-2004
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!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom webcontrol that references another webcontrol Fabricio ASP .Net Building Controls 0 09-21-2005 02:55 AM
Trapping an Exception ocurring in a Webcontrol at the Page or parent WebControl level. ASP .Net 2 01-31-2005 06:34 PM
WebControl inside of WebControl and attaching events Kasabaarde Sumta ASP .Net Building Controls 0 12-13-2004 09:51 PM
WebControl with non-WebControl property Peter Morris [Air Software Ltd] ASP .Net Web Controls 1 12-07-2004 12:25 PM
Can a webcontrol (webcontrol.dll) have a configuration file? Luis Ramírez. ASP .Net Building Controls 2 07-06-2004 04:35 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57