Home All Groups Group Topic Archive Search About
Author
25 Nov 2005 9:45 PM
christof
It'll be really easy...Sorry for that question:

I've got a MasterPage <%@ Master Language="C#" ClassName="MasterP" %>
and some slave.aspx.<%@ Page Language="C#"
MasterPageFile="~/Master1.master" AutoEventWireup="true"
CodeFile="ShowDatabases.aspx.cs" Inherits="ShowDatabases"
Title="Untitled Page" %><%@ MasterType VirtualPath="Master1.master" %>

In the slave page I'm creting and populating a TreeView which I would
like to pass to my MasterPage , where exists a TreeView Control.So I've
defined a function


//MasterPage code,

public void FetchTree(TreeView dbs)
{
         //the right code ;) // tried TreeView2 = dbs; but fails
}

//slave page code

Master.FetchTree(treeCreatedInSlave);

(There's no doubt about code, because when I type Master. the
IntelliSense sees the FetchTree method. I'm telling this, because my
problem is only in the tree.)

So how to do it without
I know I could build XML from slave tree and then get that XML in master
but I belive there's a faster way!

Thanks!!!

Author
27 Nov 2005 12:30 PM
christof
Really nobody :(

Maybe I've described the problem wrong. So I repeat:

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!
Are all your drivers up to date? click for free checkup

Author
27 Nov 2005 1:37 PM
Edwin Knoppert
What do you mean by 'site'?

If it's just another page and session remains..?
You can store it in a session or flat (xml)file.
If it's the same app. you could try to use previous page object and enum the
parts over.
Not sure if that will work.



Show quoteHide quote
"christof" <nom***@nomail.de> schreef in bericht
news:eRVQh508FHA.3976@TK2MSFTNGP15.phx.gbl...
>
> Really nobody :(
>
> Maybe I've described the problem wrong. So I repeat:
>
> 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!
>
Author
27 Nov 2005 1:46 PM
christof
Edwin Knoppert wrote:
> What do you mean by 'site'?
>
> If it's just another page and session remains..?
> You can store it in a session or flat (xml)file.
> If it's the same app. you could try to use previous page object and enum the
> parts over.
> Not sure if that will work.

There is no problem with storing it, but how to make the other TreeView
just exactly the same as one that I've created. So some kind of copying
objects.

TreeView2 is on a MasterPage
TreeView1 is on other page

TreeView2 = TreeView1;

So I've got exactly the same tree in both sites!
That's what I'm asking, thanks
Author
27 Nov 2005 3:26 PM
Edwin Knoppert
There was a question about getting controls on such pages a few days ago.
Then i assume simply copying properties?
Like styles and such.
+ copying the items of course.



Show quoteHide quote
"christof" <nom***@nomail.de> schreef in bericht
news:evMkxj18FHA.3952@TK2MSFTNGP12.phx.gbl...
> Edwin Knoppert wrote:
>> What do you mean by 'site'?
>>
>> If it's just another page and session remains..?
>> You can store it in a session or flat (xml)file.
>> If it's the same app. you could try to use previous page object and enum
>> the parts over.
>> Not sure if that will work.
>
> There is no problem with storing it, but how to make the other TreeView
> just exactly the same as one that I've created. So some kind of copying
> objects.
>
> TreeView2 is on a MasterPage
> TreeView1 is on other page
>
> TreeView2 = TreeView1;
>
> So I've got exactly the same tree in both sites!
> That's what I'm asking, thanks

Bookmark and Share