Back to all posts

Making ASP.NET 1.1 Work with FireFox

Posted on Sep 23, 2006

Posted in category:
Development
ASP.NET

As we all know browser compatibility is a major issue, trying to make your application work successfully in both IE and FireFox/Gecko-based browsers, can be a very cumbersome task without making a few changes to your ASP.NET 1.1 application. ASP.NET 1.1 automatically determines if the client's browser is an up-level or a down-level browser based on information included in the <BROWSERCAPS>section of the machine.config file. The default browser caps information included with ASP.NET 1.1 and 1.0 incorrectly identifies FireFox as a down-level browser and does not render CSS, div's, Javascript and certain other important page elements.

What exactly does this mean for your page display?  The rendered page in FireFox much larger in size as it will render panels and other controls as tables instead of spans or div's, additionally CSS styles will not be applied, therefore height and width attributes will not be applied to any controls.

The good news....it is a simple fix to alter the way that ASP.NET 1.1 and 1.0 recognizes FireFox, simply add the code included in this file to your web.Config file between the opening and closing <SYSTEM.WEB>tags.

Now, I know that looks daunting, but it simply is an addition that specifies the Browser Capabilities, hence the browserCaps XML tag. For more detailed information about the browserCaps Web.Config element, please see this MSDN article http://msdn2.microsoft.com/en-us/library/x3k2ssx2.aspx

NOTE: In ASP.NET 2.0 Microsoft has modified the standard browserCaps to correctly identify FireFox and other Gecko based browsers.