Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS not loading for Forms Authentication

I have seen several of these topics on numerous sites and I am still having an issue. I have added this to the bottom of my web.config right before the </configuaration>

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

Yet my css is still not loading for all users.

Here is the forms part of my web.config

<authentication mode="Forms">
      <forms name ="WebApp.ASPXAUTH"
            loginUrl="login.aspx"
             protection="All"
             path ="/"/>
    </authentication>
    <authorization>
      <allow users ="*"/>
    </authorization>

Is there something else I am missing?

like image 949
Matt Avatar asked Sep 12 '26 04:09

Matt


2 Answers

I put inside the css folder a webconfig with that code:

<?xml version="1.0"?>
<configuration>

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

</configuration>

Sucess! :)

like image 171
user823883 Avatar answered Sep 13 '26 17:09

user823883


Put your CSS in a non-protected folder and this should work for you.

<link rel="stylesheet" src="path of the stylesheet" type="text/css"> 
like image 27
IrishChieftain Avatar answered Sep 13 '26 18:09

IrishChieftain