saving an ASP.net dynamic menu

  • Thread starter Thread starter spx27
  • Start date Start date
S

spx27

Does anyone know the best way to handle passing a dynamic menu
generated from a login from one asp.net page to another. Would it be
better to recreate the menu on each page? Save the menu as a string
into a session variable upon login? Any other way to do this I may be
missing?
This menu is part of an intranet. The user logs in, checks SQL
database for folder permissions, then scans web directories for all
folders which match permissions and lists all files and folders under
them to create a menu tree. From what I've been reading, frames aren't
the best solution anymore...Any ideas?

-Spx27
 
i would put the menu in a user control and just include the user control in
each page rather than passing it about or storing it as a string.
that way you just have to write code to create the menu at one place (in the
user control). and a simple dropping the control in aspx pages does the job.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 
You probably don't want to have to rescan the entire folder structure every
time a page loads. So it sounds like you would want to store this
information in a session variable - maybe as some XML, or whatever is
appropriate.
 
Agreed.
Though hopefully the user control will not have to rescan all those
directories and do all the work of figuring out permissions on every page
load, but will be able to get its info from session, or elsewhere, to speed
up the menu creation.
 
Marina,

Couldnt agree more with you. my bad (I have this problem i scan the topic
rather than reading it.) so in this instance i read parts of the first
paragraph and left the rest.

i saw your message and kicked myself hard for the nth time :) thought i will
wait till someone pointed the mistake
yes in case you have to scan the directory etc with permissions then it
would be better if you just did it once and then stored it in a session.

again if you use a user control you can scan the session for an ArrayList
say of all things the users have access to. if you dont find it (the first
time after login) then build it and store it in the session and move on.
You can use this array list to build the menu.
So next time when you come the code can pick it up from the session and then
get on with menu creation.

Thanks Marina

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top