ASP:Panel Control Oddities

posted on 2005-03-25 at 22:54:14 by Joel Ross

The project I have been working on for the past year is about to launch next on Wednesday. We are in the final testing phases, fixing small issues as we go. All is on track, and going smoothly.

Until I looked at the site in Firefox. It was horrible! I got scared. The site was usable, but the formatting was way off. Our designer did a great job of testing that everything worked correctly across browers, and we implemented his spec to the pixel. It looked fine in Internet Explorer. Even wierder is that when I used the Forefox add-in to change user agents, and switched it to be IE, it also rendered fine. How could this be happening?

So I started to dig into the generated HTML of the page. It turns out that the Panel control renders as a div in IE, but as a whole table in Firefox. So using a panel around a table row (and not the whole table, or inside a table cell) reaks havoc on the layout in Firefox.

I'm not sure how many of you use Panels, or if you already knew this, but it bit us. It's pretty easy to fix too - but only if you know it's going to happen!

Categories: ASP.NET