dynamic contents/navigation frame

M

Mong

Hi,

I've developed an ASP.net application for an intranet site. Users will
be identified using Windows authentication and they will belong to one
of two roles, Admin or Users. The application uses frames with a
contents frame down the left which at the moment consists of html
tables with a href in each one which will show the appropriate page in
the main frame. Nothing too fancy.

Now, what I want to do is only show the appropriate table items in the
left frame depending on which role the user belongs to. For example if
they're in the Users role then show just a few table items but if they
belong to the Admin role then show all the items.

So my question is, what is the best way to do this? At the moment the
contents frame is just a static html page. For what I want to do, do I
need to make it an aspx page and use asp labels toggling their visible
property?

This is my first ASP.net project coming from a VB6/SQL Server
background so I'm learning along the way. Thanks for any help.

Regards,

Mong
 
G

Ganesan Subramanian

There are two methods of doing this.

1. Create Windows Group Admin and Users. Add the appropriate users to them.
In your code, Check for if the Logged In user (HttpContext->GetUser())
belongs to that role. Based on this display the appropriate menu items.
2. Create a Database table and store the Group/User/Items mapping in the
tables. Get the items for the logged in user ( using above said method) and
display the appropriate menu items.

This will work with Windows Authentication enabled in IIS and impersonation
is said to false.
If impersonation is true then use SecurityPrincipal.GetCurrent
 

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

Members online

Forum statistics

Threads
474,001
Messages
2,570,250
Members
46,848
Latest member
Graciela Mitchell

Latest Threads

Top