asp.net项目的访问级别 [英] Access Level for asp.net project

查看:60
本文介绍了asp.net项目的访问级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好...



我开发了一个Web数据库应用程序后端sql server 2008和vb代码,但我需要为任何用户创建访问级别登录到页面后用户填写注册表我想限制一些页面插入,编辑,删除和更新数据是否有任何人可以帮助这个区域



非常感谢

Hi there...

I develop one web database application the back end sql server 2008 and vb code but I need to create access level for any user when the user fill registration form after login in to the page I want to restricts some page to insert ,Edit ,Delete and Update data is there any one can help in this area

Thanks a lot

推荐答案

你所说的是授权。



通过这些链接了解ASP.NET和授权中的所有用户角色:

MSDN:如何:在ASP.NET 2.0中使用角色管理器 [ ^ ]

MSDN:ASP.NET授权 [ ^ ]

MSDN:了解角色管理 [ ^ ]

ASP.NET 2.0第一部分中的成员和角色提供者 [ ^ ]

<小时ef =http://odetocode.com/articles/428.aspx> ASP.NET 2.0第II部分中的成员身份和角色提供者 [ ^ ]



一旦ASP.NET角色和成员资格到位,你总是可以访问登录用户的角色/成员资格类型(在所有页面中)。根据角色,您可以在运行时使用控件的可见性。因此,显示特定于角色的那些。
What you talk of is called authorization.

Go through these links to understand all about User roles in ASP.NET and Authorization:
MSDN: How To: Use Role Manager in ASP.NET 2.0[^]
MSDN: ASP.NET Authorization[^]
MSDN: Understanding Role Management[^]
Membership and Role Providers in ASP.NET 2.0 Part I[^]
Membership and Role Providers in ASP.NET 2.0 Part II [^]

Once ASP.NET roles and membership is in place, you always have an access to type of role/membership of the logged in user (in all the pages). Based on the roles, you can play with the visibility of the controls at runtime. Thus, show the ones specific to a role.


这称为权限系统。我这样做的方式是所有页面上的基类,它为您提供检查权限的方法,然后在每个页面构造函数上,或者可能加载事件,您根据枚举检查当前登录用户的权限,并重定向他们没有得到许可
This is called a permissions system. The way I''d do this, is a base class on all pages that gives you methods to check permissions, then on each page constructor, or perhaps load event, you check the current logged in users permissions against an enum, and redirect if they don''t have permission


这篇关于asp.net项目的访问级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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