Web.config Combining authorization rules
I have the following authorization rules in my web.config:
<location path="Register.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.开发者_如何学Cweb>
</location>
<location path="ForgotCredentials.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
Except for the path attribute these two rules are the same. Is there a way to combine these two rules into one like path = Register.aspx, ForgotCredentials.aspx.
No, you can't. That path
property just accepts one file/directory at time.
Also consider this documents:
<location>
path attribute in web.config doesn't accept multiple paths- location Element (ASP.NET Settings Schema)
The only way would be to place them in a common folder which held the rules for all sub-files.
As far as I know, there is no way. You have to specify multiple location elements unfortunately.
精彩评论