problem: DataGrid vs Netscape 4

Discussion in 'ASP .Net Datagrid Control' started by hb, Nov 4, 2003.

  1. hb

    hb Guest

    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
    hb, Nov 4, 2003
    #1
    1. Advertising

  2. 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.
    Jacob Yang [MSFT], Nov 5, 2003
    #2
    1. Advertising

  3. hb

    hb Guest

    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

    "Jacob Yang [MSFT]" <> wrote in message
    news:...
    > 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.
    >
    hb, Nov 5, 2003
    #3
  4. 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.
    Jacob Yang [MSFT], Nov 6, 2003
    #4
  5. hb

    hb Guest

    Jacob,

    The code works!

    Thank you very much!!!
    "Jacob Yang [MSFT]" <> wrote in message
    news:BMcFM$...
    > 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.
    >
    hb, Nov 6, 2003
    #5
    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. Bernt Fischer
    Replies:
    2
    Views:
    2,187
    Guogang
    Aug 28, 2003
  2. Tom
    Replies:
    0
    Views:
    490
  3. Mickey Segal
    Replies:
    1
    Views:
    659
    Mickey Segal
    May 21, 2004
  4. Brian Smith

    datagrid formatting doesn't work with netscape

    Brian Smith, Jul 28, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    131
    Brian Smith
    Jul 28, 2003
  5. yaktipper
    Replies:
    10
    Views:
    277
    Richard Cornford
    Jul 10, 2003
Loading...

Share This Page