Directory references IIS


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
 
Ad

Advertisements

E

Eliyahu Goldin

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
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top