Link to home
Start Free TrialLog in
Avatar of dantcho
dantchoFlag for United States of America

asked on

ASP.NET: Different Role --> Different versions of the same page?

Hello experts,

I have an asp.net application on my company's intranet. I am using windows authentication to capture the user's identity and active directory group. My application knows these AD groups as roles. I want to have three versions of an asp.net webform, each version tied to only a specific role.

There would be a data entry role that can only see the most limited page, a supervisor role that sees supervisory information that the data entry role cannot see, and an admin role that can see everything from the other two roles in one screen. How would I make it so that my application checks to see what role a user is part of, and based on that role decide what page to show them?

note: I already know that I can create folders in my website and give those folders their own web.config files that restrict use of a page to a specific role, and that isn't what I want to do, because then I would have to have three links for a user to click on and block certain links based on role. I want the user to AUTOMATICALLY come to the correct page for them based on their role and not ever have the option of clicking on the pages / folders of the other roles.

Please advise,
thank you
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Hi,

My suggestion is for you to redirect all users to a single intermediate page (in the page load for example) that inspects the user role and then appropriately, redirect a user again to the proper asp.net web page.

ASKER CERTIFIED SOLUTION
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dantcho

ASKER

Excellent, simple to follow example and clearly explained.
Avatar of dantcho

ASKER

Perfect, tried and this does exactly what I wanted. Thank you very much for your help!