Authentication Forms and CSS-File

  • Thread starter Michael Haberfellner
  • 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
 
T

Tim Mackey

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
 
M

Michael Haberfellner

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top