你需要把它的主要配置元素之间:
<configuration>
<!--You have other configuration elements here-->
<location path="passwordrecovery.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>
只是不要忘了接受你原来的问题的答案
更新
重要的是要注意,上面假定passwordrecovery.aspx
文件位于与包含上述配置的web.config
文件位于相同的位置。如果passwordrecovery.aspx
文件位于其他位置,则需要更改path
属性。
所以,假设web.config
是在你的站点的根目录,而passwordrecovery.aspx
文件是文件夹/Presentation/Display
,然后你将需要如下更新代码:
<configuration>
<!--You have other configuration elements here-->
<location path="Presentation/Display/passwordrecovery.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>
另一种选择是保持提供原始配置,但将其创建在位于与passwordreovery.aspx
文件相同的文件夹中的新文件web.config
中。
之前 .... authentication>或之后? –
DEN
2010-11-29 06:46:37