Relative Addressing and VS2003 Problem

G

Guest

I am unable to configure the addressing for images so that I can see them in
a) the VS 2003 IDE, b) the site as hosted on my local machine, and c) the
site as hosted in production.

As an example, I have an <asp:image...> on the same page as an <IMG...>.
Both controls are specified to display the same image file. However, in
order to see both render image at the same in development, I need to address
one as ../ and the other as ./

I am also using a User Control that is accessed by pages in a top directory
and a lower directory.

As you can probably imagine, this is driving me nuts, and any help would be
much appreciated.

Jeb
 
N

Nathan Sokalski

That does sound strange, but I would feel more comfortable if I could see
the actual code you are using in your *.aspx file.
 
G

Guest

With server controls (e.g., asp:Image) you can use the tilde (~) character at
the beginning to create the path from the root of the app (or site)
Peter
 
G

Guest

Thanks for your input. I now remember this device (~) from way back, on
Frontpage. It seems to work most of the time but not all of the time. Here
are two lines from the HTML view of my page:

<asp:Image id="Image2" ImageUrl="~/SpotImages/paw.jpg" width="16"
height="16" runat="server"></asp:Image>

<asp:Image id="Image3" ImageUrl="../SpotImages/paw.jpg" width="16"
height="16" runat="server"></asp:Image>

In VS2003, only the second displays paw.jpg in the design view.

Is there a rock-solid technique?. For example, a global defined in
web.config that explicitly declares the root and some kind of wrapper that
prepends the root string to a relative reference? I have a feeling that this
should be well-trodden path, but I am unable to get on it. Any ideas?

Jeb.
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top