Forms Authentication not working for specific page

陌路散爱 提交于 2019-12-05 18:26:05

edit2: So the solution isn't only in the comments :
As far as i know you cannot specify an authenticationmode per location.
You could set the forms authentication mode throughout your site and only require logged in users in the secure parts.

edit:
mmmh strange , are you sure you only edited the ~ away?
They discuss your problem here but i can't imagine how changing the ~ would trigger it.
Could you perhaps post your entire web.config?
Also : are you using iis 6 and virtual directories?

The ~ sign is not needed , try this :

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