Build my treeview only once

Not sure how to fix this:
I have a master page. I reserve the left side for my menu options.
I have, for example, 5 pages. on p5.aspx, I display the treeview.
User clicks on a node and goes to p6.aspx.

*** issue: I have to keep building the treeview for each page. I want to build it once and have it stick for all the pages. Do I need to use a second master page with only the treeview on it? I even used a usercontrol but even with that..with each node clicked, with each new page displayed, the side treeview has to be built.
Any ideas?
LVL 8
CamilliaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ShazbotOKCommented:
if you have the treeview in the page_load statement you may want to setup validation as to "isnewsession" or "ispostback" so the object does not get rebuilt every time
0
monarch_ilhanCommented:
You may keep your treeview structure in a Session object. After creating/populating treeview in first load, put it to the session ( Session["MyLoadedTree"]=myTreeViewControlName; ) And in other pages load event you can unbox session object and add a panel control.

TreeView tvw=(TreeView)Session["MyLoadedTree"];
Panel1.Controls.Add(tvw);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CamilliaAuthor Commented:
I do have "ispostback" . Each page will use Master page.  I did this for uniform look and feel.
So, p1.aspx, p2.aspx, p3.aspx, p4.aspx. p5.aspx...ALL have the Master page.

I display the treeview in p5.aspx and want it to stick.

Now, p6.aspx (this is the one related to the treeview node) also has the master page. So, when i click on the node, i go to p6.aspx, Master page is called again and the treeview has to be binded again. Otherwise, outside ispostback, inside ispostback wont make a differece.

I dont think this is doable..i think i have to keep rebuilding the treeview for each page that I call from the treeview node...
0
CamilliaAuthor Commented:
Monarch - i didnt see your note , let me read...
0
CamilliaAuthor Commented:
Do you think keeping the treeview in a session is not bad...at most 100 users... 20 nodes and at most 20 subnodes under SOME of the nodes...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.