September 23, 2006

Making ASP.NET 1.1 Work with FireFox

As we all know browser compatibility is a major issue, trying to make you 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.

tags: Tutorials, ASP.NET
comments powered by Disqus

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Content Copyright

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.