Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > absolute paths when using "View in Browser" on local port

Reply
Thread Tools

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

 
 
Amil Hanish
Guest
Posts: n/a
 
      07-16-2006
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


 
Reply With Quote
 
 
 
 
Shawn Wildermuth (C# MVP)
Guest
Posts: n/a
 
      07-16-2006
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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paths, gentleman, paths Ohad Lutzky Ruby 2 11-07-2006 02:15 AM
Repost: absolute paths when using "View in Browser" on local port Amil Hanish ASP .Net 0 07-26-2006 12:49 AM
Site absolute paths? Julie ASP .Net 2 05-13-2004 03:39 PM
Absolute paths with multiple volumes Donald Perl 1 03-07-2004 05:09 PM
Convert between Windows style paths and POSIX style paths Noah Python 5 07-11-2003 09:25 PM



Advertisments