我在web.config上有以下内容
<location path = "WebPages/Reports">
<system.web>
<authorization>
<deny roles="DeniedRole1, DeniedRole2"/>
<allow roles="AllowRole1,AllowRole2,AllowRole3"/>
</authorization>
</system.web>
</location>
<location path = "WebPages/Reports/SpecificPage.aspx">
<system.web>
<authorization>
<allow roles ="*"/>
</authorization>
</system.web>
</location>
基本上我要做的是让每个人都能访问SpecificPage.aspx,但对于Reports文件夹中的任何其他页面,它应该应用deny / allow规则。但是,这给了我以下错误:
Parser Error Message: Authorization rule names cannot contain the '*' character.
感谢任何帮助!
答案 0 :(得分:3)
尝试
<location path = "WebPages/Reports/SpecificPage.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>