• 关于页面验证问题


       今天在写程序的时候遇到了这个问题,在网上查了半天,终于找到原因.下面来总结一下
       我想让用户在访问我的程序的Admin文件夹下的页面时需要登录,而在访问其他页面时则不需要,也就是说Admin文件夹下的文件拒绝匿名访问.
       下面是配置根目录下的web.config文件中关于授权验证的配置
       <system.web>
            <authentication mode="Forms">
                <forms loginUrl="Admin/Login.aspx"></forms>
            </authentication>
            <authorization>
                <allow users="*"/>
            </authorization>
       </system.web>
       <location path="Admin">
            <system.web>
                <authorization>
                    <deny users="?"/>
                </authorization>
            </system.web>
       </location>
       注意location节,location节不需要<authentication>节了,假若加了的话,便会出现"在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' "这样的错误了,若在子文件下添加配置文件时也要注意相同的问题.

  • 相关阅读:
    jQuery中 $ 符号的冲突问题
    典型用户,场景,用例图
    结对编程
    简易计算器
    对git的认识
    我的博客
    零基础免费搭建个人博客-hexo+github
    DTcmsV4.0分析学习——(3)URL重写
    DTcmsV4.0分析学习——(2)系统框架
    DTcmsV4.0分析学习——(1)数据库结构分析
  • 原文地址:https://www.cnblogs.com/guozengxin/p/2879415.html
Copyright © 2020-2023  润新知