Authentication Forms and CSS-File

  • Thread starter Thread starter Michael Haberfellner
  • Start date Start date
M

Michael Haberfellner

hi aspx-community!

i do have a (for me) unsolvable problem:

i'm using authentication mode="Forms" in my web.config and use my own
login-system. all that works fine.

the only problem i have: i'm using in the login.aspx a css-file for the
styles which the login.aspx ignores completely - exept if i start the
project directly with the login.aspx from the visual web development
studio. then the css-file is included correctly.

did anybody have the same trouble allready? is there an explanation or
solution? any ideas?

thank you for your help

greets from vienna/austria

mike
 
hi mike,
greets from dublin.
it sounds like an authorisation problem. when you have forms authentication
turned on, asp.net actually blocks out non asp.net content , so your style
sheet (and images etc) will give a 403 unauthorised error and not work on
the page. to my knowledge, this is new in .net 2.

to work around it, add the following authorization exceptions to your
web.config. i've also included one for an images folder:

<location path="styles.css">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>

hth
tim

----- Original Message -----
From: "Michael Haberfellner" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Tuesday, January 16, 2007 2:15 PM
Subject: Authentication Forms and CSS-File
 
thanx! perfect - that worked!

Tim said:
hi mike,
greets from dublin.
it sounds like an authorisation problem. when you have forms
authentication turned on, asp.net actually blocks out non asp.net
content , so your style sheet (and images etc) will give a 403
unauthorised error and not work on the page. to my knowledge, this is
new in .net 2.

to work around it, add the following authorization exceptions to your
web.config. i've also included one for an images folder:

<location path="styles.css">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>

hth
tim

----- Original Message ----- From: "Michael Haberfellner" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Tuesday, January 16, 2007 2:15 PM
Subject: Authentication Forms and CSS-File
 
Back
Top