469,097 Members | 1,561 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,097 developers. It's quick & easy.

absolute paths when using "View in Browser" on local port

I use the VS 2005 option "View in browser" to often view my web site. If I
have a link in there like:

<img src="/graphics/myimage.jpg">

This doesn't work even though the image is really there. I'm sure this has
to do with the fact that the page is being served out of the virtual
server/port that VS fires up to serve the page.

This seems bogus...I can't even see my content? Am I doing something wrong?
I've tried using stuff like ~/graphics/myimage.jpg, but that doesn't work
either.

Amil
Jul 16 '06 #1
1 1273
Hello Amil,

Typically you'll need it to be a relative path not a root path for this to
work. I usually do the ~/graphics/myimage.jpg trick, but that means that
the <img /needs a runat="server" in the tag.

HTH
Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
I use the VS 2005 option "View in browser" to often view my web site.
If I have a link in there like:

<img src="/graphics/myimage.jpg">

This doesn't work even though the image is really there. I'm sure
this has to do with the fact that the page is being served out of the
virtual server/port that VS fires up to serve the page.

This seems bogus...I can't even see my content? Am I doing something
wrong? I've tried using stuff like ~/graphics/myimage.jpg, but that
doesn't work either.

Amil

Jul 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Lorem Ipsum | last post: by
1 post views Thread by dw | last post: by
1 post views Thread by Nalaka | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.