Solved

Dynamic treeview - (create usercontrol??)

Posted on 2007-12-04
6
965 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
  • 3
  • 3
6 Comments
 
LVL 8

Accepted Solution

by:
Chumad earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 7

Author Comment

by:Camillia
Comment Utility
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
Comment Utility
Just wondering if you'll be awarding points on this one or not :)
0
 
LVL 7

Author Comment

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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Retain selection in datagridview 2 22
Object to array 7 26
Problem to go to Web page 2 46
Showdialog 8 20
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now