Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Forms Authentication prevents loading javascript on Login.aspx

I am experiencing problems with Forms Authentication. When I try to load my Login.aspx page neither javascript nor stylesheets do not load. Here is part of my web.config file

        <authentication mode="Forms">
        <forms loginUrl="Login.aspx"
               timeout="30"
               name=".ASPXAUTH"
               path="/"
               requireSSL="false"
               slidingExpiration="true"
               defaultUrl="Main.aspx"
               cookieless="UseDeviceProfile" />
    </authentication>

    <authorization>
        <deny users="?" />
    </authorization>

Help me, please, to understand what's happening.

like image 872
Tror Avatar asked Sep 10 '10 16:09

Tror


1 Answers

You need to add exceptions to those directories or files in your web.config, underneath the <configuration> element.

<configuration>
  <system.web>
     ...
  </system.web>

  <location path="css">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
</configuration>
like image 200
jon3laze Avatar answered Oct 16 '22 06:10

jon3laze