Thursday, September 29, 2005

Browser Caps for ASP.Net websites

Recently, the client I work for, ACH Direct, went on a Firefox compatibility drive. Though Firefox is used by only 7% of the market, as against IE's 93% in US, it is gaining popularity in Europe and Asia with usage hitting close to 40% of the market. With our clients insiting that our application needs to support FireFox and Mac OS we had to start working on it. The first time I looked at the website in Firefox, some of the pages really shocked me. The layout was badly messed up, and the table borders made the site look ugly. I immediately searched the Internet for the problem and I found something interesting.
ASP.Net applications use a lot of attributes defined in the web.config file. If those attributes are not defined in the web.config file, then the application picks it from the machine.config file in the Windows root directory. When the VS.Net 2003 version came out, Microsoft added Mozilla and a lot of other non IE browsers as down-level browser,which means the way ASP.Net server controls, panels, and div tags render themselves in the browser is different for IE and Firefox(HTML 4 rendered as HTML 3). To fix the problem, one needs to constantly update the browser capabailities section in the web.config file. If you want the change to show up in all the applications sitting on the IIS web server, the machine.config file needs to be updated(Always keep a backup just in case something gets really screwed up).

MSDN Resource

Keep an eye on this site for the latest browser caps update
Rob Eberhardt

0 Comments:

Post a Comment

<< Home