如何在Web页面Asp.net上授予用户权限 [英] How to give user rights on Webpages Asp.net

查看:66
本文介绍了如何在Web页面Asp.net上授予用户权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

i已经在Asp.net 3.5 c#上创建了网站,有一些网页,如Home,Aboutus,Downloads,SignUp,Quiz,Chat,Help等等。



有四种类型的用户将访问此网站管理员用户,Office用户,管理用户,普通用户。



现在我想要的是在创建用户页面,它向我显示我的网站在复选框列表中的所有网页。现在,当我创建管理员用户时,我将通过在复选框列表中选择所有内容来授予所有页面权限,就像他/她可以访问主页,关于我们.......所有页面等等。如果我正在创建普通用户我只是希望他/她只能访问主页,关于我们,帮助,而不是所有我将从复选框列表中选择的页面。与Office用户和管理用户相同,我将提供特定页面权限。并使用用户权限在Sql-Server数据库中保存创建用户数据。



有没有办法做到这一点?或者如果您有任何其他想法给予用户网页权限请帮助..................

Hello,
i have created website on Asp.net 3.5 c#, There are Some Webpages like Home,Aboutus,Downloads,SignUp,Quiz,Chat,Help etc etc.

There are Four type of users who will access this Website Admin Users, Office Users, Management Users, Normal users.

Now what i want is in Create User page it shows me all Webpages of my website in Check-box list. now when i am creating admin user i will give all pages rights by selecting all in Check-box list, like he/she can access Home,About-us.......all pages Etc. if i am creating Normal user i just want that he/she can access only Home,About-us,Help, Not all pages which i will select from check-box list. Same like for Office User & Management User i will give specific pages rights. And save Create-user Data in Sql-Server database with User Rights.

Is there any way to do this ? or if you have any other idea to give webpages rights to Users Please Help..................

推荐答案

你会发现很多关于你的场景的例子这是所有应用程序的基本要求,它可以很容易地完成,检查下面的链接



ASP.NET身份验证和授权 [ ^ ]



http://msdn.microsoft.com/en-us/library/vstudio/ wce3kxhd(v = vs.100).aspx [ ^ ]
You will find lots of example regarding your scenario this is basic requirement of all applications and it can be done very easily check the below links

ASP.NET authentication and authorization[^]

http://msdn.microsoft.com/en-us/library/vstudio/wce3kxhd(v=vs.100).aspx[^]


彻底阅读下面提到的文章。根据你的问题,你会发现它非常有用。



表单身份验证提供程序
Read the below mentioned article thoroughly. You will find it very useful according to you r question.

Forms Authentication Provider


这篇关于如何在Web页面Asp.net上授予用户权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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