授权问题 [英] Problem with authorization

查看:76
本文介绍了授权问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!!!!

我创建了一个角色管理员".然后我创建了一个名为Admin的用户.
现在,我正在尝试为我的网站中的页面设置授权.

登录控件工作正常.但是我无需登录即可访问该页面.

我在我的web.config中添加了此设置以设置授权

Hi all!!!

i have created a role "Administrators". then i created a user named Admin.
Now i am trying to set authorization for a page in my website.

Login controls are working fine. But i am able to access the page without logging in.

i added this in my web.config to set authorization

<location path="~/Admin/Pages/AdminCategories.aspx">
  <system.web>
    <authorization>
      <allow roles="Administrators"/>
      <deny users="*"/>
    </authorization>
  </system.web>
</location>

推荐答案

检查身份验证设置...由于身份验证失败,您遇到了问题(因为U编写了U可以不登录而访问该页面). br/>
最好看看下面的URL

http://msdn.microsoft.com/en-us/library/aa291347 (v = vs.71).aspx [
Check the Authentication setting...Ur getting the problem due to authentication failure (as U have written U can access the page without logging in).

Better to look at the following URL

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

If you find this post solves Ur issue, please mark it as answer.


这篇关于授权问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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