简体   繁体   中英

authorization web.config

I am restricting access to the Account folder using below:

<location path="Account">
  <system.web>
    <authorization>
      <deny users="?"/>
      <allow users="*"/>
    </authorization>
  </system.web>
</location>

and access to the Default.aspx using

<location path="Default.aspx">
  <system.web>
    <authorization>
      <deny users="?"/>
      <allow users="*"/>
    </authorization>
  </system.web>
</location>

but how do I restrict access to a specific file in the Account folder rather than the entire folder?

I tried the following but did not work

<location path="Account\ChangePassword.aspx">
  <system.web>
    <authorization>
      <deny users="?"/>
      <allow users="*"/>
    </authorization>
  </system.web>
</location>

Try this

<location path="Account/ChangePassword.aspx">
  <system.web>
    <authorization> 
      <deny users="?"/>
    </authorization> 
  </system.web> 
</location>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM