Saturday, June 11, 2005

ASP.NET and FireFox

ASP.NET does something called "adaptive rendering", which allows ASP.NET to be backwards compatible to Html 3.2 in cases where it is necessary. In other words, depending on the browser, ASP.NET will "adapt" how it "renders" its html.

As it turns out, the default configuration for ASP.NET 1.1 (hopefully they'll fix this in 2.0) currently renders Firefox (which hardly existed when 1.1 was created) in Html 3.2. This can cause problems. For example, if you have a ListBox control, for IE it is given a width via css (style="width: 250px;", for example). But, if Firefox is the browser, it renders it using Html 3.2, and does NOT include the style tag. Thus you are going to have serious display differences depending on the browser.

Fear not! You can change that by changing either the web.config or machine.config, depending on your preference. It is actually quite simple. Check out this article to find out how:

A Look at ASP.NET's Adaptive Rendering at 4GuysFromRolla.