By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,098 Members | 1,950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

TreeView problem

P: n/a
I've got a really easy problem, please help me:

There are two pages in one I'm creating a TreeView like that:

TreeView dbTree = new TreeView();

TreeNode dbTreeRoot = new TreeNode("Root");
dbTree.Nodes.Add(dbTreeRoot);
..
..

- so my complete TreeView is populated in that code.
Now I wish to pass this whole TreeView to another site, where I've got
my TreeView Control:

<asp:TreeView ID="TreeView2" runat="server">
</asp:TreeView>

So how to pass this tree to put it into that control??

I thing that it should be a function in the second page:

public void FetchTree(TreeView source_tree)
{
// - the code, I've tried TreeView2 = source_tree, but it's not a solution
}

Or the only way is to save a TreeView to XML in a first, and then to
retrive it from XML in a second page to the control directly.

Thank you in advance!
Nov 27 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi christof
you will have to save treeview controls data somewhere and pass this data to
other page
you could use Session, Application state to use this

I suggest you to pass encoded XML to second page and then read it and build
second tree

Hope this help

--
Galin Iliev [MCSD, MCSD.NET]
Senior Software Developer
www.wordassist.com

"christof" <no****@nomail.de> wrote in message
news:u9*************@TK2MSFTNGP11.phx.gbl...
I've got a really easy problem, please help me:

There are two pages in one I'm creating a TreeView like that:

TreeView dbTree = new TreeView();

TreeNode dbTreeRoot = new TreeNode("Root");
dbTree.Nodes.Add(dbTreeRoot);
..
..

- so my complete TreeView is populated in that code.
Now I wish to pass this whole TreeView to another site, where I've got my
TreeView Control:

<asp:TreeView ID="TreeView2" runat="server">
</asp:TreeView>

So how to pass this tree to put it into that control??

I thing that it should be a function in the second page:

public void FetchTree(TreeView source_tree)
{
// - the code, I've tried TreeView2 = source_tree, but it's not a
solution
}

Or the only way is to save a TreeView to XML in a first, and then to
retrive it from XML in a second page to the control directly.

Thank you in advance!

Nov 27 '05 #2

P: n/a
Galin iliev wrote:
Hi christof
you will have to save treeview controls data somewhere and pass this data to
other page
you could use Session, Application state to use this

I suggest you to pass encoded XML to second page and then read it and build
second tree

Hope this help


But you mean to do xml from scratch?

XmlDocument ...
...
or is there a ready method TreeView -> XML?

Thanks
Nov 27 '05 #3

P: n/a
There is no method until .net 2.0

christof wrote:
Galin iliev wrote:
Hi christof
you will have to save treeview controls data somewhere and pass this
data to other page
you could use Session, Application state to use this

I suggest you to pass encoded XML to second page and then read it and
build second tree

Hope this help


But you mean to do xml from scratch?

XmlDocument ...
...
or is there a ready method TreeView -> XML?

Thanks

Nov 27 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.