This is my first StackOverflow post, but this site is awesome. Thanks in advance for any help you can give.
I have a website that gives users access to various pages based on their rights, so each user must have the dynamic creation of his own menu when entering the system. However, user settings will probably not change very often.
Currently, the site has a wizard page that extracts a list of its pages from the database and creates a menu. It does this every time the user loads the page.
I would like to reduce calls to the database, so I started to enter menu data into the session variable. I was hoping that someone more experienced could help me make sure that this is the best way to do this. I would prefer to save it on the user's computer rather than on the server.
I have my main page load:
User u = new User(Page.User.Identity.Name, Globals.getCnString());
DataTable menu;
if(Session["MENU"] == null)
{
Session["MENU"] = u.getMenu();
}
menu = (DataTable)Session["MENU"];
foreach (DataRow r in menu.Rows)
{
}
Thanks again!
source
share