images not found

Discussion in 'ASP .Net' started by tshad, Sep 16, 2008.

  1. tshad

    tshad Guest

    I am using VS 2008 and in my aspx page my images are showing with squigly
    lines (technical term) and saying that image not found.

    But when it runs it finds them fine. The images are defined:

    <asp:ImageButton ID="UpQuestion" visible="true" runat="server"
    ImageUrl="~/images/arrowUp.gif" style="height:16px;width:16px;
    vertical-align:middle" CommandName="Up" OnClick="moveQuestionRowUp"
    AlternateText="^"/>&nbsp;

    <asp:ImageButton ID="DownQuestion" visible="true" runat="server"
    ImageUrl="~/images/arrowDown.gif" style="height:16px;width:16px;
    vertical-align:middle" CommandName="Down" OnClick="moveQuestionRowDown"
    AlternateText="v"/>

    Why is that?

    Also, if I have the path as the following, it still says not found and in
    this case doesn't display:

    ImageUrl="/images/arrowDown.gif"

    I thought that the "/" said you start at the root and images is in the root,
    so why doesn't it work here.

    Also, if I have the path as the following, it still says not found and in
    this case does display:

    ImageUrl="images/arrowDown.gif"

    The page is in the root so I would expect it to display. But in all cases,
    it says images not found - when in fact they are there.

    Thanks,

    Tom
     
    tshad, Sep 16, 2008
    #1
    1. Advertising

  2. tshad

    Hans Kesting Guest

    After serious thinking tshad wrote :
    >
    > ImageUrl="/images/arrowDown.gif"
    >


    This searches for that image in the root of the site, so for instance
    http://www.company.com/images/arrowDown.gif.

    Your development system usually uses (virtual) subdirectories, so the
    root of your site would be something like http://localhost/AppRoot/.
    That image is requested as http://localhost/images/arrowDown.gif, which
    probably is wrong.

    You could use
    ImageUrl = "~/images/arrowDown.gif";
    to make sure that image is alwas requested from the root of your
    *application* (instead of the *server*).

    But even then: usually I (as developer) know the URL will be valid when
    the complete page is shown in the browser, but VS can't figure this
    out. So you can then ignore that "squiggly line".


    Hans Kesting
     
    Hans Kesting, Sep 16, 2008
    #2
    1. Advertising

  3. tshad wrote:
    > I am using VS 2008 and in my aspx page my images are showing with
    > squigly lines (technical term) and saying that image not found.


    What happens if you include them in the solution in the solution explorer?

    N.b. If you add several thousand images, it might take several hours to
    include them, during which time VS appears to be hung.

    Andrew
     
    Andrew Morton, Sep 16, 2008
    #3
  4. tshad

    tshad Guest

    "Hans Kesting" <> wrote in message
    news:uv%23Dtx$...
    > After serious thinking tshad wrote :
    >>
    >> ImageUrl="/images/arrowDown.gif"
    >>

    >
    > This searches for that image in the root of the site, so for instance
    > http://www.company.com/images/arrowDown.gif.
    >
    > Your development system usually uses (virtual) subdirectories, so the root
    > of your site would be something like http://localhost/AppRoot/. That image
    > is requested as http://localhost/images/arrowDown.gif, which probably is
    > wrong.
    >
    > You could use
    > ImageUrl = "~/images/arrowDown.gif";
    > to make sure that image is alwas requested from the root of your
    > *application* (instead of the *server*).
    >

    I agree and that was how it actually is.

    > But even then: usually I (as developer) know the URL will be valid when
    > the complete page is shown in the browser, but VS can't figure this out.
    > So you can then ignore that "squiggly line".
    >

    So it is a bug in VS. It should know where it is. It created the project
    so it knows were the root is

    And this doesn't explain "images/arrowDown.gif", it was showing is not there
    which is absolutely wrong. It is supposed to start from where the page is
    (and I am not using a user control here) which is in the root already as is
    the images folder (which is why it works on the web page). This doesn't
    even involve looking for the starting point of the path - the starting point
    is where you are at.

    So why does VS say it can't find it?

    Thanks,

    Tom

    >
    > Hans Kesting
    >
    >
     
    tshad, Sep 16, 2008
    #4
  5. tshad

    tshad Guest

    "Andrew Morton" <> wrote in message
    news:...
    > tshad wrote:
    >> I am using VS 2008 and in my aspx page my images are showing with
    >> squigly lines (technical term) and saying that image not found.

    >
    > What happens if you include them in the solution in the solution explorer?
    >
    > N.b. If you add several thousand images, it might take several hours to
    > include them, during which time VS appears to be hung.
    >

    Not sure.

    I will have to check when I get home. I'll let you know.

    Thanks,

    Tom
    > Andrew
    >
     
    tshad, Sep 16, 2008
    #5
  6. tshad

    tshad Guest

    "tshad" <> wrote in message
    news:...
    >
    > "Andrew Morton" <> wrote in message
    > news:...
    >> tshad wrote:
    >>> I am using VS 2008 and in my aspx page my images are showing with
    >>> squigly lines (technical term) and saying that image not found.

    >>
    >> What happens if you include them in the solution in the solution
    >> explorer?
    >>
    >> N.b. If you add several thousand images, it might take several hours to
    >> include them, during which time VS appears to be hung.
    >>

    > Not sure.
    >
    > I will have to check when I get home. I'll let you know.


    Just checked and I don't have include them in the folder. I noticed they
    weren't showing in the images folder. When I right-clicked the folder and
    hit refresh - they all showed up and the squigly lines disappeared from my
    aspx page.

    Thanks,

    Tom
    >
    > Thanks,
    >
    > Tom
    >> Andrew
    >>

    >
    >
     
    tshad, Sep 17, 2008
    #6
    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. William Parker
    Replies:
    1
    Views:
    3,095
    Martin
    Jun 27, 2004
  2. Replies:
    3
    Views:
    551
  3. John Kotuby

    Page and Images not found on Localhost

    John Kotuby, Feb 22, 2007, in forum: ASP .Net
    Replies:
    12
    Views:
    757
    Larry Bud
    Apr 12, 2007
  4. Trent Mick
    Replies:
    0
    Views:
    478
    Trent Mick
    Apr 3, 2008
  5. Jacob Davis
    Replies:
    0
    Views:
    502
    Jacob Davis
    Apr 15, 2008
Loading...

Share This Page