tags:

views:

210

answers:

5

I want to use my site style sheet on the logon page.

I have the following in my web.Config but I'm not allowed at the css page unless I'm logged in

  <location>
    <system.web>
      <authorization>
        <deny users="?" />
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="~/App_Themes/Layout.css">
    <system.web>
      <authorization>
        <allow users = "*" />
      </authorization>
    </system.web>
  </location>
A: 

Try including the CSS style sheet in the HTML head tag...

<link rel="Stylesheet" type="text/css" href="Style.css" />

Hope that helps :)

Chalkey
A: 

Try doing this in the allow tag for your CSS:

<allow users="*,?" />
Marcus L
Nope! Didnt work :-(
AJM
+3  A: 

You shouldn't have the first location tag- remove that. The config should be (assuming you are using Forms authentication):

    <configuration>
       <system.web>
         <authentication mode="Forms"> 
         </authentication>
         <authorization>
           <deny users="?" />
         </authorization>
       </system.web>
       <location path="App_Themes/Layout.css">
          <system.web>
            <authorization>
              <allow users="*" />
            </authorization>
          </system.web>
       </location>
    </configuration>
RichardOD
+1  A: 

I think your problem is about the path in here :

<location path="~/App_Themes/Layout.css">

try to put exac location of the css file like that :

<location path="App_Themes/Layout.css">
Canavar
@Canavar- I've upvoted this as you had a partial solution.
RichardOD
A: 

you can give id to the head tag of the page and then add the external css to this head when your page is loaded.

Vinay Pandey