Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

CSS styles and images not applied on login page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
R.A.M. - 11 Oct 2007 05:53 GMT
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/

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.