473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using string as datasource of TreeNodeSrc on TreeView

Hi

I'm having a problem with a tree view. The data source for this an XML
string set using the TreeView.TreeNodeSrc property in the code behind
page. The XML is generated by a stored procedure and is as follows
(there are no line breaks in the original - I've added these for
readability):
<TREENODES>
<TreeNode NodeData="1" CheckBox="true" Checked="false"
Text="Business"/>
<TreeNode NodeData="93" CheckBox="true" Checked="false"
Text="Community and living"/>
<TreeNode NodeData="204" CheckBox="true" Checked="false"
Text="Education and learning"/>
<TREENODES>

I store this XML in a string (strMyXML) and then set the TreeNodeSrc
property in my code as follows:
TreeView1.Nodes[0].TreeNodeSrc = strMyXML;

Usually this runs with no problems, but sometimes the page brings back
an error of the famous "The XML loaded from TreeNodeSrc=<[my XML
here]>, TreeNodeXslSrc= did not contain the required outer <TREENODES>"
variety. On looking through the IIS logs for this, I've discovered
that on these occasions, although I am still passing a string
containing XML to the TreeNodeSrc property, it is incorrectly assuming
that I am passing it a URL, and as a consequence is searching for a
page using my XML as the URL (eg, http://mydomain/<TREENODES><TreeNode
NodeData="1" CheckBox="true" Checked="false"
Text="Business"/></TREENODES>).

Is there any way I can force the treeview to recognise that I am
passing it some XML to parse and not a URL? Or is there something in
my XML file that might cause the TreeNodeSrc property to parse it
incorrectly?

Thanks very much for any help!

Nov 19 '05 #1
0 1387

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: serge calderara | last post by:
dear all, Is there an easy way to bind a treeview control with an XML object as datasource? In a similar way as the dataset is doing, and build columns accroding to XML node, I could imagine a...
0
by: imassadpk | last post by:
Hi all, Apprecite your help in resolving this tricky issue... I am trying implementing Recurrsive TreeView in MS. Access 2003 ADP project. So far, no luck :( The Problem: This sample...
1
by: emferrari | last post by:
Hi everybody I have two treeviews, one of them is only to receive items dragged from the treeview1. I want to know how to drag a full node information to the treeview2. I know how to do that...
2
by: Chris | last post by:
Hi, anyone experience with the TreeView control that is available in the Microsoft.Web.UI.WebControls component ? I want to add a few nodes to the TreeView-control but don't know quite how :...
1
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and...
2
by: garyusenet | last post by:
I could do with something similiar, can you tell me if you think this would work for me, and if there's any advantage in working with controls this way than how I currently am. At the moment...
0
by: jiing | last post by:
Hi all, I want to use sting(the same as Node.Text) to judge if a node exists in TreeView. I've tried several ways, but seems all failed. could anybody help me? Thanks in advance. //My...
2
by: ippo | last post by:
Hi all, I would like to know if is possible to populate a treeview using a xmlstring in a c# class. thank you all Bruno
2
by: makennedy | last post by:
Hi Experts, Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere. Basically I have a TreeView Control which I have created...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.