Directory references IIS

  • Thread starter Thread starter bob
  • Start date Start date
B

bob

Hi,
VS2008
Target Framework 2.0
I have some images in a 'styles' subdirectory in my ASP.net project.
e.g.
<img src=\styles\logo.png" alt="logo is missing" />

When I run the project within the IDE no problem.
When I publish the site and access it via a browser I get the alt
text.

If I add a copy of the image to the project at the same level as the
webform and alter the path. No problem.
i.e. <img src="logo.png" alt="logo is missing" />

Is there a trick to using subdirectory references, may be an IIS
setting or something? I have never done this before.
thanks
Bob
 
Try

<img runat="server" src="~/styles/logo.png" alt="logo is missing" />

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


bob said:
Hi,
VS2008
Target Framework 2.0
I have some images in a 'styles' subdirectory in my ASP.net project.
e.g.
<img src=\styles\logo.png" alt="logo is missing" />

When I run the project within the IDE no problem.
When I publish the site and access it via a browser I get the alt
text.

If I add a copy of the image to the project at the same level as the
webform and alter the path. No problem.
i.e. <img src="logo.png" alt="logo is missing" />

Is there a trick to using subdirectory references, may be an IIS
setting or something? I have never done this before.
thanks
Bob

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4765 (20100112) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4765 (20100112) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
Back
Top