problem: DataGrid vs Netscape 4

H

hb

Hi,

I have a product.aspx page that has a DataGrid containing images. I save the
html source code
of the page into product.htm. When I open product.htm from IE, it behaviors
exactly as product.aspx.
But when I open it from Netscape 4.1, all images jump out from datagrid and
are displayed on the
top of the page.

The image is inserted into datagrid using <asp:templatecolumn>:
<asp:templatecolumn headertext="Image">
<itemtemplate>
<asp:image runat="server" imageurl='<%#
"/images/"+DataBinder.Eval(Container.DataItem, "thumb") %>' borderwidth="0">
</asp:image>
</itemtemplate>
</asp:templatecolumn>

In the HTML source code, the <img> appears like:
<img src="/images/prodthumb/10634.jpg" style="border-width:0px;" />

If I replace: style="border-width:0px;" by border="0" in the above <img>,
the product.htm will appear
properly in Netscape4.1, otherwise, the image will jump out of datagrid. It
seems that Netscape 4.x
doesn't support "style" attribute in <img>.

There is a way in asp.net that allows me to set the server controls not
generating "style" attribute but
regular attribute?

Thank you

Hongbo
 
J

Jacob Yang [MSFT]

Hi Hongbo,

Based on my research and experience, I would like to share the following
information with you. I am not familiar with Netscape and I have not
Netscape at hand for testing because it is a third party product. My
solution is not fully tested. Thank you for your understanding. The
followings are my testing steps:

1. Create a default web application.

2. Put an Image control on the form.

3. In the property window, please make sure that the value of BorderWidth
is empty.

4. Set the ImageUrl to some picture.

5. Now the HTML code will looks like the following:
...
<asp:Image id="Image1" style="Z-INDEX: 102; LEFT: 104px; POSITION:
absolute; TOP: 184px"
runat="server" Width="249px" Height="48px"
ImageUrl="file:///F:\Movies.JPG"></asp:Image>
...

6. Build and run the application. Right click the page and select "View
Source". We will see the following HTML code.
...
<img id="Image1" src="file:///F:\Movies.JPG" border="0"
style="height:48px;width:249px;" />
...

So I believe that the key of this issue should be removing borderwidth="0".

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
H

hb

Hi, Jacob,

I have tested your approach with Netscape 4.0. It works!

Thank you very much!!!

By the way, is there anything we can do to make the "backcolor" attribute in
<asp:tablecell> in *.aspx turn out as "bgcolor" in <td> in HTML source code?
Currently, it's converted into "style" attribute.

Hongbo
 
J

Jacob Yang [MSFT]

Hi Hongbo,

We can make use of the Attributes collection on the tablecell object. For
example, the following code snippet is to add the "bgcolor" attribute to
certain tablecell, which will be rendered as "bgcolor" of <td> tag.

Table1.Rows(0).Cells(0).Attributes.Add("bgcolor", "#C0FFC0")

If I have misunderstood your concern, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top