aspx thread: Dynamically loading menu based on user login.
Message #1 by "raj" <rwave74@y...> on Sun, 12 Jan 2003 07:20:48
|
|
hi guys,
I would like to load menu based on user login. how can i do this.Should i
have a different copy of menu for each user?
thanks in advance
raj
Message #2 by "Mitchell Adams" <MADAMS@p...> on Mon, 13 Jan 2003 09:20:42 -0500
|
|
I've tested for roles and then added items appropriately to a drop down
list. The same thing could be used with other controls. Not sure if this
is the best way but it works. Anyone have any other suggestions?
Dim RoleSA as Boolean
RoleSA =3D HttpContext.Current.User.IsInRole("SA")
If RoleSA Then
PageSelect.Items.Add("Web Site Administration")
PageSelect.Items.FindByText("Web Site Administration").Value =3D "Hyperlink
"
End If
=09
If RoleSA OR RolePR Then
PageSelect.Items.Add("Public Relations")
PageSelect.Items.FindByText("Public Relations").Value =3D "Hyperlink"
End If
<asp:DropDownList id=3D"PageSelect" runat=3D"server" />
>>> rwave74@y... 01/12/03 07:20AM >>>
hi guys,
I would like to load menu based on user login. how can i do this.Should
i
have a different copy of menu for each user?
thanks in advance
raj
Message #3 by "rk" <ravi@v...> on Mon, 13 Jan 2003 18:26:10
|
|
you should move your menus into usercontrols. create a public property for
user's login. set the login in the form_load event of your .aspx webpage.
this will help you to consolidate all of your menus in one file as user
control.
hope this helps.
--rk
www.visualsoftinc.com
> hi guys,
> I would like to load menu based on user login. how can i do this.Should
i
h> ave a different copy of menu for each user?
> thanks in advance
r> aj
|