By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,795 Members | 1,761 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,795 IT Pros & Developers. It's quick & easy.

Authentication Forms and CSS-File

P: n/a
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
Jan 16 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <un******@gmx.at>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Tuesday, January 16, 2007 2:15 PM
Subject: Authentication Forms and CSS-File

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
Jan 16 '07 #2

P: n/a
thanx! perfect - that worked!

Tim Mackey wrote:
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" <un******@gmx.at>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Tuesday, January 16, 2007 2:15 PM
Subject: Authentication Forms and CSS-File

>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

Jan 18 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.