Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CSS styles and images not applied on login page

0 views
Skip to first unread message

R.A.M.

unread,
Oct 11, 2007, 12:53:02 AM10/11/07
to
Hi,
I have created ASP.NET application with forms authentication (Login.aspx).
The problem is that although Login.aspx contains CSS styles and JPEG/GIF
images, usually the styles are not applied and images are not displayed. I
mean, if I run application from Visual Studio at about 80% of times the
styles and images are not applied - black and white page without images
(only rectangular ares). I am not sure but I think I saw this effect on my
friend's computer where I installed my application.
Please help.
/RAM/


Eliyahu Goldin

unread,
Oct 11, 2007, 4:18:08 AM10/11/07
to
Make sure you are using virtual path to the images and css rather than
physical one. I mean it should be something like
"~/ImageDir/image.gif"
rather than
"c:\mywebroot\ImageDir\image.gif"

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"R.A.M." <r_ahi...@poczta.onet.pl> wrote in message
news:fekivh$r32$1...@news2.task.gda.pl...

Jesse Houwing

unread,
Oct 11, 2007, 11:11:25 AM10/11/07
to
Hello R.A.M.,

> /RAM/

Make sure you set a allow all rule for the directory with images and stylesheets
in your web.config file. Otherwise the url for the image is redirected to
the login page as well.

--
Jesse Houwing
jesse.houwing at sogeti.nl


bruce barker

unread,
Oct 11, 2007, 11:47:18 AM10/11/07
to
you probably have your site configured to require authentication for
css and images files. thus they can not appear on the login page.

-- bruce (sqlwork.com)

R.A.M.

unread,
Oct 12, 2007, 7:35:45 AM10/12/07
to
Uzytkownik "bruce barker" <nos...@nospam.com> napisal w wiadomosci
news:uQ$aO4BDI...@TK2MSFTNGP05.phx.gbl...

> you probably have your site configured to require authentication for css
> and images files. thus they can not appear on the login page.

In application root folder I have Web.config with:

<authentication mode="Forms">

<forms name="MIM-Magazyn" loginUrl="Login.aspx"/>

</authentication>

<authorization>

<deny users="?"/>

</authorization>

Styles.css are placed in the root folder. Images are placed in Images
subfolder but this subfolder doesn't contain any Web.config.

Is my configuration incorrect?

/RAM/


0 new messages