471,612 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

TreeView problem

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
3 3604
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
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
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.

Similar topics

2 posts views Thread by sai bo shan via DotNetMonster.com | last post: by
6 posts views Thread by Jan Krouwer | last post: by
3 posts views Thread by johnb41 | last post: by
4 posts views Thread by christof | last post: by
reply views Thread by R.A.M. | last post: by
1 post views Thread by tanya foster | last post: by
1 post views Thread by Rick | last post: by
6 posts views Thread by David | last post: by
reply views Thread by =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post: by
reply views Thread by leo001 | last post: by

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.