My web app, built using ASP.NET 4 MVC2 architecture in Visual Studio 2010, has been deployed to my local IIS server under the virtual directory EasyMan4. Recently, I added an image to the Content Folder via Solution Explorer. In the Site.Master page, I inserted the following img tag:
<img src="../../Content/HomeIcon.png" height="64" width="64" alt="Home" />
It's worth mentioning that the css file is linked as follows:
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
Despite both files being in the same location, when accessing the site through http://localhost/EasyMan4/
, the css loads correctly but the png does not.
The project displays flawlessly when launched via Visual Studio Development Server. However, the IIS fails to render the image properly.
Closer examination revealed that while the css file was located at
http://localhost/EasyMan4/Content/site.css
, the image was sourced from http://localhost/Content/HomeIcon.png.
Since I am not very familiar with the IIS manager and haven't made any changes except for authentication settings (disabling all types except Windows Authentication), I seek guidance on resolving this issue to ensure proper display of images.