Relative Addressing and VS2003 Problem

Discussion in 'ASP .Net' started by =?Utf-8?B?SmViQnVzaGVsbA==?=, Jun 9, 2006.

  1. 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
    =?Utf-8?B?SmViQnVzaGVsbA==?=, Jun 9, 2006
    #1
    1. Advertising

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

    http://www.nathansokalski.com/

    "JebBushell" <jebbushell AT yahoo DOT com> wrote in message
    news:...
    >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
    >
    Nathan Sokalski, Jun 9, 2006
    #2
    1. Advertising

  3. 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

    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "JebBushell" wrote:

    > 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
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Jun 9, 2006
    #3
  4. 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.


    "Peter Bromberg [C# MVP]" wrote:

    > 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
    >
    > --
    > Co-founder, Eggheadcafe.com developer portal:
    > http://www.eggheadcafe.com
    > UnBlog:
    > http://petesbloggerama.blogspot.com
    >
    >
    >
    >
    > "JebBushell" wrote:
    >
    > > 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
    > >
    =?Utf-8?B?SmViQnVzaGVsbA==?=, Jun 12, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon
    Replies:
    2
    Views:
    408
    Simon Harvey
    May 17, 2004
  2. Tom Cloyd

    array addressing problem

    Tom Cloyd, Jun 16, 2008, in forum: Ruby
    Replies:
    2
    Views:
    135
    Tom Cloyd
    Jun 16, 2008
  3. adam
    Replies:
    7
    Views:
    225
  4. Dennis Yurichev
    Replies:
    2
    Views:
    237
    Dennis Yurichev
    Dec 6, 2012
  5. Replies:
    3
    Views:
    102
    Nobody
    May 31, 2014
Loading...

Share This Page