Login question for ASP.NET - Allow page by user

ptemo
ptemo used Ask the Experts™
on
Hello all,

I would like to allow certain pages to be restricted except for a  few users.  Most of the things I see on the web allow restrictions by folders, but not by indivdual page.  I'm using ASP.net 3.5 with visual studio 2010.  

Thank you
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Does your users belongs to same role? Then you can implement role-based authorization for the pages. Also, If all the users are not of same role than you need to implement custom logic in each page load. But in that case your number of users should be very low.

Author

Commented:
Hello

Thank you for responding.  Yes the users belong to the same role.  How do implement a role based authorization.

thanks
You can try using User.IsInRole.  Check the role-based security part within the link.

http://support.microsoft.com/kb/306590#5
Commented:
@ptemo

Check the Alred1's link. You can check if the user is of particular role and than redirect him/her if he is not allowed to access content.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial