Sounds like what you need is to use a sitemap provider for your menu and have security trimming enabled.
This should get you started in the right direction...
http://msdn2.microsoft.com/en-us/library/system.web.sitemapprovider.aspx
http://msdn2.microsoft.com/en-us/library/system.web.xmlsitemapprovider.aspx
http://msdn2.microsoft.com/en-us/library/ms227425.aspx
Here's my design, if you're interested (not sure this is the best way or not, I'm self-taught):
First, I create custom Roles and manage them in my database. Then I allow roles access to directories and files in my application via the web.config, like this...
<location path="roles.aspx">
<system.web>
<authorization>
<allow roles="ManageRoles"/>
<deny users="*" />
</authorization>
</system.web>
</location>
<location path="groups.aspx">
<system.web>
<authorization>
<allow roles="ManageGroups"/>
<deny users="*" />
</authorization>
</system.web>
</location>
<location path="users.aspx">
<system.web>
<authorization>
<allow roles="ManageUsers"/>
<deny users="*" />
</authorization>
</system.web>
</location>
Note: You don't have to create custom roles, you can put in the Windows Group names like this...
<location path="users.aspx">
<system.web>
<authorization>
<allow roles="BUILTIN\Administrators"/>
<deny users="*" />
</authorization>
</system.web>
</location>
<location path="groups.aspx">
<system.web>
<authorization>
<allow roles="mydomain\mygroupname"/>
<deny users="*" />
</authorization>
</system.web>
</location>
If you choose to not use custom roles, then you may want to consider adding this to your web.config...
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"/>
The trick is getting those roles assigned to the current logged in windows user.
To do this, I create a Global Application Class (global.asax) and within the Application_PostAuthenticateRequest() event I have code that does the work necessary to build an ArrayList of Roles that the user should be in.
Once I have the ArrayList (named "UserRoles") populated with the names of the roles I want to assign to the current user, I create a GenericPrinciple and assign it to the Context.User and System.Threading.Thread.CurrentPrinciple, as shown below:
' Convert ArrayList of Objects into an Array of Strings
ReDim aryRoles(UserRoles.Count)
UserRoles.CopyTo(aryRoles)
' Assign new principle to the system security Context and Thread for THIS user
Context.User = New System.Security.Principal.GenericPrincipal(Context.User.Identity, aryRoles)
System.Threading.Thread.CurrentPrincipal = New System.Security.Principal.GenericPrincipal(Context.User.Identity, aryRoles)
Note: I also make sure to put the windows groups the user is currently in, into that list or roles as well.
Here's a way to get the names of the roles a user is in... (this is way faster than Active Directory)
Dim sb As StringBuilder = New StringBuilder
Dim WinId As IIdentity = User.Identity
Dim userId As WindowsIdentity = DirectCast(WinId, WindowsIdentity)
sb.Append("<br /><b>Windows Groups</b> for: " & userId.Name)
Dim irefGroups As IdentityReferenceCollection = userId.Groups.Translate(GetType(NTAccount))
Dim idRef As NTAccount
For i As Integer = 0 To irefGroups.Count - 1
idRef = irefGroups(i)
sb.Append("<br />" & idRef.ToString)
Next
Label1.Text = sb.ToString()
I know, my method is a little complex. But I do it because my intranet web applications are "products" that I sell to clients. They set up their sites and they are not all that technical. So I need to be able to provide them a web interface that they can use to authorize users easily either by the Windows User Account name (domain\user) or Windows Group name (domain\group). With thousands of possible users, Forms authentication was out of the question. (What a nightmare for a non-technical person to have to deal with). In my method, they can utilize pre-existing windows groups and be up and running quickly.
Hope this helps.
There are no stupid questions, only easy answers. However, the quality of assistance you receive (if any) is directly proportional to the quality of your request.
p.s. Please remember to "mark as answer" all posts that answer your question.