Securing a folder in ASP.NET web directory

烂漫一生 提交于 2019-12-07 22:29:29
asawyer

Use the <location /> tags in the web.config, http://msdn.microsoft.com/en-us/library/b6x6shw7(v=vs.71).aspx

  <location path="content">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>

See this answer for more links to msdn documentation: https://stackoverflow.com/a/4280257/426894

You can try with this config in your Web.config (location permit you to define path)

This sample use roles in order to design profil.

Also use users in order to design user.

<location path="~/MembersOnly" > 
  <system.web> 
    <authorization> 
      <allow roles="Members"/> 
      <deny users="?" /> 
    </authorization> 
  </system.web> 
</location> 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!