IE8 img scr="" displays a red X

C

christy

In my code behind I turn images on and off using the visible attribute. In
IE7 if I set img1.visible = false, the img tag for img1 is removed from the
code, and nothing is shown:
<td align="center">


</td>
the same code in IE8 leaves the img tag in the HML, makes scr="", and the
result is a box with a red X:
<td align="center">
<img id="pg2_V_dgClassList_sec2_row2_img1" src="" align="middle" />
</td>

with both browsers, if the img is visible, the code is the same:
<td align="center">
<img id="pg2_V_dgClassList_sec2_row1_img1"
src="/attention_red.gif" />
</td>
 
B

bruce barker

to the browser, <img src=""> means load the current url (page) as an
img. in IE8 (as other browsers), if the server response is not a valid
image (which it isn't because its html) it displays as a broken image
(as is proper).

you should make an empty image (say empty.gif), that you img references
when you want it empty.

-- bruce (sqlwork.com)
 
P

Patrice

Or double check ? This is suprising as when a control is not visible, it's
html code is not rendered to the browser. I don't see why it would change
with IE8...
 
C

christy

Thanks Bruce,
That doesn't entirely answer my question though. Why would the code:

img1.visible = false;

in the C# code behind result in different source code in IE8 than IE7
In IE7 when I View Source there is no img tag. In IE8 I get the img tag
with scr="".
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top