如何在asp.net c#中设置页面级别权限? [英] how to set page level permission in asp.net c#?

查看:178
本文介绍了如何在asp.net c#中设置页面级别权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

告诉我在asp.net C#中设置页面级别权限的步骤。我开发了一个具有10个aspx页面的Web应用程序。

如果用户具有管理员权限,他们可以查看所有页面。如果用户是注册用户,他们只能查看

只有5个aspx文件。如果用户点击未经授权的菜单,我必须显示错误消息,例如您无权查看

此页面内容。

Hi sir,
Tell me the steps to set page level permission in asp.net C#. I developed one web application that have 10 aspx page.
If the user has administrator rights , they can able to view all the pages. If the user is a registered user, they can able to view
only 5 aspx file. If the user clicks the menu that is not authorized, i have to show error msg like "You are not authorized to view
this page content".

推荐答案

您最好的选择是使用会员提供商修改您的网站

基本上在ASP.Net中搜索会员提供者教程Google和你们都已经确定了。

一些示例链接:

了解ASP.NET角色和成员资格 - 初学者教程 [ ^ ]

http://www.asp.net/web-forms /教程/安全/会员/验证用户的凭据,对,在我mbership-user-store-cs [ ^ ]

http://www.asp.net/web-forms/tutorials/security/membership/creating-the-membership-schema -in-sql-server-cs [ ^ ]

http://theintegrity.co.uk/2010/11/asp-net-mvc-2-custom-membership-provider-tutorial -part-1 / [ ^ ]

http://msdn.microsoft.com/en-us/library/6tc47t75.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/44w5aswa.aspx [ ^ ]



祝你好运,

OI
Your best option will be modify your site by using Membership Providers.
Basically search for Membership Provider Tutorials in ASP.Net in Google and you are all set.
Some example links:
Understanding ASP.NET Roles and Membership - A Beginner''s Tutorial[^]
http://www.asp.net/web-forms/tutorials/security/membership/validating-user-credentials-against-the-membership-user-store-cs[^]
http://www.asp.net/web-forms/tutorials/security/membership/creating-the-membership-schema-in-sql-server-cs[^]
http://theintegrity.co.uk/2010/11/asp-net-mvc-2-custom-membership-provider-tutorial-part-1/[^]
http://msdn.microsoft.com/en-us/library/6tc47t75.aspx[^]
http://msdn.microsoft.com/en-us/library/44w5aswa.aspx[^]

Good luck,
OI


您好,

您可以使用ASP.NET身份验证和授权在ASP.NET页面中提供安全性。

使用以下链接了解..







创始人的身份验证和授权指南 [ ^ ]



表单身份验证和基于角色的授权:更快,更简单,更正确的方法 [ ^ ]



http://www.4guysfromrolla.com/articles/031204-1.aspx [ ^ ]
Hi,
You can use ASP.NET authentication and authorization to provide security in ASP.NET pages.
use following link to understand ..



Beginner''s Guide to Authentication and Authorization[^]

Forms Authentication and Role based Authorization: A Quicker, Simpler, and Correct Approach[^]

http://www.4guysfromrolla.com/articles/031204-1.aspx[^]


最佳选择是asp.net会员。



您将成功解决有关表锁或事务死锁的问题。



1.使用Microsoft SQL Server 2005设置ASP.NET成员资格提供程序数据库

2.创建用户

3.创建角色在角色中添加用户

4.Provider基于角色的安全性到您的应用程序

5.重定向授权用户查看他有权查看的网站部分

6.Password恢复控制和配置。

7.单点登录/单点登录/单点登录



点击以下链接了解更多详情:



ASP.NET成员资格


这篇关于如何在asp.net c#中设置页面级别权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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