views:

164

answers:

3

Suppose I have 3 kinds of users and their accessible pages in my ASP.net application are as follows:

(1) User Type-A {Default.aspx, a.aspx, b.aspx and c.aspx},

(2) User Type-B {Default.aspx, d.aspx, e.aspx and f.aspx},

(4) Admin {Default.aspx and g.aspx}.

Here Default.aspx is my Login-page.

I am using Membership Provider and Forms authentication technique.

Now I need to block access of one type of user to the pages assigned for other type users.

How should I configure my Web.config file?

and What kind of c# code should be used?

A: 

Role management in asp.net may help you in this case. Please check this article. You may have to customize this as per your specific requirement. Hope this helps.

Role Manager in ASP.NET

Each of User-Type will be associated with Roles.

rajesh pillai
A: 

We have a similar requirement, and make use of the Patterns and Practices Web Client Software Factory. Basically it assists you in creating modules, and allowing you to specify per-page access levels in config based on Role / User details.

Furis
A: 

You might have a try to use roleship provider and web.sitemap.

michele