Click here to Skip to main content
15,746,064 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am working application. I have one web site called First.UI and I published this using Publish with Filesystem option.
Using IIS7, I created application say FirstWebSite and I mapped this to "Default AppPool".
I am able to see Images folder inside the FirstWebsite.
The issue is that whenever I am browsing any page, it is not showing the images.
When I see the path it is showing like "localhost/images/imagename.jpg" I think this path is incorrect. Hence it is not loading the image.
The actual path to load the image is "localhost/FirstWebsite/images/imagename.jpg" and I don't why it is not taking this path.

Kindly let me know what is the mistake here. The same thing happening for css also.

Thanks in Advance

Dayakar D.N

Use image path like

'images/imagename.jpg' or
'../images/imagename.jpg' or

in your image tag. Surely one method will help you.
Share this answer
Sounds like it is relative path issue. At times, after deployment the path referenced as a source for images, stylesheets, etc is not correctly formed. This leads to no file found at the location referred because of which images don't download or style-sheets does not get applied.
You would need to make sure that the path is correct such that file is found and used.

I would suggest you to use this Tip and resolve the path correctly before setting the source of the file: Resolving Paths in a Multi-Folder WebSite[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900