My menu control uses HTML/CSS dynamically generated from a user control. I am using an XML config file for this, but my idea was to store the users perms in the DB and have the user control make a new menu by reading that info from the DB. You can cache that user control to avoid a DB hit on every postback.
But the new asp.net 2.0 has a couple nice controls to do this work. There's a standard Menu control that has a lot of flexibility. This links to the Sitmap, which can have group info. Basically, you assign users a group that determines their menu, and the sitemap decides which group gets which menu options, and the the menu control dynamically gets his info from the sitemap. It's a simple, but powerful design.
Of course, you can tie in personalization, and you'll want to use the membership features to set up and utilize user accounts. It easily eliminates maybe 75% of the code you need to write, plus its more flexible for end users. They can pick a favorite skin, for example. This is basically done using something like CSS (a skin file ia a lot like CSS but the rules are different from CSS in terms of what elements override each other).
All of this will be in the second edition of our favorite book.
|