?
Solved

Dynamic treeview - (create usercontrol??)

Posted on 2007-12-04
6
Medium Priority
?
971 Views
Last Modified: 2012-06-27
I need to build a treeview menu BUT each user can have a different order to the treeview nodes.

The order of the nodes is in the database for each user. The text of the nodes is also in the database.

What's the best way to do this? create a usercontrol , build the treeview based on the user's node-order, bind the text of the nodes...ALL in a usercontrol...reading the node-order from teh database

 Or maybe hold the order of the nodes in a Cookie instead of going to the database all the time...

any ideas/
0
Comment
Question by:Camillia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 8

Accepted Solution

by:
Chumad earned 2000 total points
ID: 20406843
How often do the menu options and order change? If they change often, then you'd have to come up with a way to refresh the cookie after a change occurred.

Also, I don't think it would matter a lot either way if you put this in a usercontrol or directly on a page -- EXCEPT for the fact that if you need this menu on many pages across your site you'd have to duplicate code. So if you need it on many pages, put it either in a user control or in a master page.

As far as the technique, it sounds like you've thought it out a bit. My personal preference would be to get it from the database each time instead of from a client-side cookie -- unless of course the menu was HUGE and you were expecting 100's to thousands of simultaneous users, at which point I'd consider caching it in the session.
0
 
LVL 7

Author Comment

by:Camillia
ID: 20406911
the order of the menu is set once for each user. Doesnt change reguarly. maybe once or twice but usually, it's a one time thing...

Menu is only 40 nodes. At most, maybe 100 users at peak time .

Menu will only be on one page. My code has masterpage, so maybe i'll stick with master-page and just have it there...

0
 
LVL 8

Expert Comment

by:Chumad
ID: 20406964
Just look at all the pro's and con's:

1. If you query the database each time and you have LOTS of users, you might notice a slowdown of the site (it would take a very large number of users before you'd notice anything.) Plus is that it's easy to do and just as easy to maintain.

2. If you use a cookie, the data could get stale.  Also, reading a cookie could prove tricky depending on the situation. A plus to this is that you wouldn't be using up a lot of system resources for this method.

3. If you use a session, you gain from the fact that you don't have to query the database on every page hit; however, you will be using up system RAM to store the session value for each user.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Author Comment

by:Camillia
ID: 20407648
thanks, session might not be bad idea... suppose 100 users, 40 rows of data that's char(3).
0
 
LVL 8

Expert Comment

by:Chumad
ID: 20414098
Just wondering if you'll be awarding points on this one or not :)
0
 
LVL 7

Author Comment

by:Camillia
ID: 20414169
yes, sorry. was just logging in to assign points. Thanks for you help.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question