Search code examples
htmlinternet-explorerfirefoxasp.net-3.5rendering

Why is my Aspx page rendering different HTML in FireFox and IE


I have come across a problem where, my asp.net code is being rendered differently on Firefox and IE. When I say differently, I mean, A linkButton in IE renders as anchor tags. On Firefox however, it renders as a span

code example

<ItemTemplate>
   <div id="<%#Eval("Id","{0}") %>">
     <asp:LinkButton ID="ProductName" runat="server" CommandName="Listing" 
       CommandArgument='<%# Bind("Id") %>' Text='<%# Bind("Name") %>PostBackUrl=""></asp:LinkButton>
     <asp:Label ID="lbl_pricePerUnit" runat="server" Text="" />
   </div>
</ItemTemplate>

Some other controls aren't rendered at all, though visible.alt text alt text

I have no idea what's going on here and I have never seen this happen before. I am using the latest versions of the browsers and I have asp.net 3.5 and VS2008

UPDATE: Ok this is an AJAX page, the gridview is inside an update panel which reacts to the OnCommand event of the LinkButton. The code obviously compiles, and it runs fine on IE.

I have checked the Page Source on firefox and it is the same as the image. There was a good point made about the lack of ID on the containing DIV tag. Does embedded script cause problems for FireFox? What about id's beginning with numbers?


Solution

  • I am very emabarrased to admit that I have made the most absent minded of blunders

    Jay S very rightly pointed out that I should make sure I'm looking at the correct instance of the code. Some of the links on the local version are pointing to the Dev version on the Dev Server. It is not up to date and actually has old code running there from before the product names were converted to links.

    Apologies for wasting the collective brain energy and thank you all for your replies.