473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Membership question: Menus based on role

I have 3 roles in my ASP.NET webapp: Admin, Manager & User (higheset to
lowest)

When the user logs in I want 1 or more custom menues to appear:
Admin: Show menu1, menu2, menu3
Manager: Show menu2, menu3
User: Show menu3

What is the best way to do this? In the past I've used 3 panels which I
turned invisible based on the role in the Form_Load event. But, I know
there must be a better way to show the correct menus based on the role
assigned to the user.

I experimented a bit with the LoginView control, but couldn't get it to show
up right, for example...
<asp:RoleGroup Roles="Admin">
<ContentTemplate>
This only shows up for the ADMIN
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="Admin,Manager">
<ContentTemplate>
This only shows up for the MGR
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="Admin,Manager,User">
<ContentTemplate>
This only shows up for the USER
</ContentTemplate>
</asp:RoleGroup>

When logged in as an ADMIN I would expect all 3 to show up but only the
ADMIN one shows up.

Any ideas?

Thanks in advance!
Oct 9 '07 #1
0 970

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jack | last post by:
Hello, I am looking for a Form Based Role Authentication Example in VB.NET. If anyone has one please post. Thanks in advance for all you help, Jack
2
by: Randy Yates | last post by:
Forgive me if this is a basic and trivial (i.e., stupid) question. I haven't been using postgres very long, and I'm not an experienced database system developer. I noticed that there is a very...
0
by: JP | last post by:
Hi , In our intranet, we need a custom windows based authentication where we would have the following 1. All User accounts are valid domain NT ID's 2. Active Directory Group WOULD NOT be used...
4
by: Pony Tsui | last post by:
I was install the starter kits CLUB, and created a CLUB WEB SITE, this application use the MemberInfo table in club.mdf to store the membership'data, but i can not find out where to define or...
11
by: Nospam | last post by:
I don't know what it is I am doing wrong, I am trying to get the menus to either expand or contract based on their previous states, i.e if already expanded if clicked again contract, and if...
1
by: TheCornjerker | last post by:
With ASP.Net 2.0, I have setup a custom login screen that first authenticates against and SQL membership provider and if that fails, against an Active Directory provider. I'm wanting to have one...
1
by: VB Programmer | last post by:
Using ASP.NET 2.0 with Memberships. I have 2 folders, admin and client. Each folder has a sitemap file, admin.sitemap and client.sitemap, in the appropriate directory. I have a master page...
1
by: soni2926 | last post by:
hi, we're building a site which will have common pages for different users, but certain sections will show different content based on the membership of the logged in user, like admin, manager,...
1
by: Bobby Edward | last post by:
I am using the built in ASP.NET membership provider. All files in the 'members' subfolder is only accessible by those in role 'member'. I want a user to be able to create 'sub-user' accounts. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.