ASP.NET - 用户等级和积分明智的页面访问 [英] ASP.NET - UserType-wise page access

查看:98
本文介绍了ASP.NET - 用户等级和积分明智的页面访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有3个类型的用户,在我的ASP.net应用程序的访问页面如下:

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}.

下面 Default.aspx的是我的登录页面。

我使用的成员资格提供程序和Forms身份验证的技术。

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.

我应该如何配置我的的Web.config 文件?

How should I configure my Web.config file?

和应该使用什么样的C#code的?

and What kind of c# code should be used?

推荐答案

在asp.net角色管理可以帮助你在这种情况下。请查看这篇文章。
您可能需要自定义此根据您的具体要求。希望这有助于。

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.

角色管理器在ASP.NET

的用户类型每个将与角色有关。

Each of User-Type will be associated with Roles.

这篇关于ASP.NET - 用户等级和积分明智的页面访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆