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 - 11 Oct 2007 09:18 GMT
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"

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> Hi,
> I have created ASP.NET application with forms authentication (Login.aspx).
[quoted text clipped - 6 lines]
> Please help.
> /RAM/
Jesse Houwing - 11 Oct 2007 16:11 GMT
Hello R.A.M.,
> Hi,
> I have created ASP.NET application with forms authentication
[quoted text clipped - 11 lines]
> friend's computer where I installed my application.
> Please help.
> /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 - 11 Oct 2007 16:47 GMT
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)
> Hi,
> I have created ASP.NET application with forms authentication (Login.aspx).
[quoted text clipped - 6 lines]
> Please help.
> /RAM/
R.A.M. - 12 Oct 2007 12:35 GMT
> 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/