Re: broken image problem

Discussion in 'ASP .Net' started by George, Feb 25, 2009.

  1. George

    George Guest

    <img src="~/Images/logo.jpg" />
    that is why you get broken image
    ~ symbol only works with server controls.
    so
    <img src="~/Images/logo.jpg" runat=server/>
    will work
    but try
    <img src="/ProjectName/Images/logo.jpg" />



    George.


    "Jeff" <> wrote in message
    news:...
    > hi
    >
    > asp.net 3.5
    >
    > When running my Default.aspx page I get a broken image. I don't know why I
    > get "broken image". The image is in ~\Images\ I've also used
    > ="../Images/logo.jpg" to access the image...
    >
    > <table style="width:100%;">
    > <tr>
    > <td>
    > <img src="~/Images/logo.jpg" />
    > </td>
    > <td>dfh</td>
    > <td>dfghdgh</td>
    > </tr>
    > </table>
    >
    >
    > any suggestions
    >
    >
     
    George, Feb 25, 2009
    #1
    1. Advertising

  2. George

    Hans Kesting Guest

    Jeff brought next idea :
    > I've tried them and they don't work...
    >
    > Now I try
    > <asp:Image ID="Image1" ImageUrl="~/Images/logo.jpg" runat="server" /> which
    > does not work :(
    > I specified the ImageUrl value by using the dialog that appear when I press =
    >
    > Not sure it has something to do with this problem but in IE7 (I'm testing
    > against IE7) a yellow line with this message appear at the top : "Intranet
    > settings are now turned off by default. Intranet settings are less secure
    > than Internet settings"
    >
    > any sugestions?
    >


    I don't think it has anything to do with those "intranet settings".

    Try and view the generated HTML (View Source in IE), locate the <img>
    tag and see what the URL is. Is the image really at that location?

    Maybe (just a guess) the root of your application is not where you
    expect it to be?

    Hans Kesting


    >
    >
    > "George" <> wrote in message
    > news:...
    >> <img src="~/Images/logo.jpg" />
    >> that is why you get broken image
    >> ~ symbol only works with server controls.
    >> so
    >> <img src="~/Images/logo.jpg" runat=server/>
    >> will work
    >> but try
    >> <img src="/ProjectName/Images/logo.jpg" />
    >>
    >>
    >>
    >> George.
    >>
    >>
    >> "Jeff" <> wrote in message
    >> news:...
    >>> hi
    >>>
    >>> asp.net 3.5
    >>>
    >>> When running my Default.aspx page I get a broken image. I don't know why I
    >>> get "broken image". The image is in ~\Images\ I've also used
    >>> ="../Images/logo.jpg" to access the image...
    >>>
    >>> <table style="width:100%;">
    >>> <tr>
    >>> <td>
    >>> <img src="~/Images/logo.jpg" />
    >>> </td>
    >>> <td>dfh</td>
    >>> <td>dfghdgh</td>
    >>> </tr>
    >>> </table>
    >>>
    >>>
    >>> any suggestions
    >>>
    >>>

    >>
     
    Hans Kesting, Feb 26, 2009
    #2
    1. Advertising

  3. George

    Hans Kesting Guest

    Jeff formulated on donderdag :
    > now I created a new website at c:\Downloads\ and have a image in the root
    > folder:
    >
    > <body>
    > <form id="form1" runat="server">
    > <div>
    > <img src="test.JPG" />
    > </div>
    > </form>
    > </body>
    > </html>
    >
    > the html output from the browser is:
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >
    > <html xmlns="http://www.w3.org/1999/xhtml">
    > <head><title>
    > Untitled Page
    > </title></head>
    > <body>
    > <form name="form1" method="post" action="Default.aspx" id="form1">
    > <div>
    > <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
    > value="/wEPDwUJNzgzNDMwNTMzZGSeSIUqywKRzPwSJqMSGgkRv9v/dA==" />
    > </div>
    >
    > <div>
    > <img src="test.JPG" />
    > </div>
    > </form>
    > </body>
    > </html>
    >
    > Still the same problem, I get broken images. I've tested this in Opera also,
    > same problem there.
    > any suggestions?


    I suppose the URL of the page was http://localhost/Default.aspx.
    What happens if you change that to http://localhost/test.JPG ?
    If all works OK, you should get just that image. But when there is some
    error, you should now see the error message instead of just a broken
    image.

    Hans Kesting
     
    Hans Kesting, Feb 27, 2009
    #3
    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. Charlie

    Re: Broken image problem

    Charlie, Jun 23, 2003, in forum: HTML
    Replies:
    9
    Views:
    3,773
    Wipkip
    Jun 23, 2003
  2. Steven D'Aprano

    Why are "broken iterators" broken?

    Steven D'Aprano, Sep 21, 2008, in forum: Python
    Replies:
    8
    Views:
    675
  3. Cameron Simpson

    Re: Why are "broken iterators" broken?

    Cameron Simpson, Sep 22, 2008, in forum: Python
    Replies:
    0
    Views:
    601
    Cameron Simpson
    Sep 22, 2008
  4. Fredrik Lundh

    Re: Why are "broken iterators" broken?

    Fredrik Lundh, Sep 22, 2008, in forum: Python
    Replies:
    0
    Views:
    619
    Fredrik Lundh
    Sep 22, 2008
  5. Jeff

    broken image problem

    Jeff, Apr 29, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    466
    William Niver
    Apr 29, 2009
Loading...

Share This Page