Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: broken image problem

Reply
Thread Tools

Re: broken image problem

 
 
George
Guest
Posts: n/a
 
      02-25-2009
<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
>
>


 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      02-26-2009
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
>>>
>>>

>>



 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      02-27-2009
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


 
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
broken image problem Jeff ASP .Net 1 04-29-2009 12:05 PM
Why are "broken iterators" broken? Steven D'Aprano Python 8 09-28-2008 09:19 PM
Re: Why are "broken iterators" broken? Fredrik Lundh Python 0 09-22-2008 04:32 PM
Re: Why are "broken iterators" broken? Cameron Simpson Python 0 09-22-2008 04:32 AM
Re: Broken image problem Charlie HTML 9 06-23-2003 07:25 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57