Jeffrey Palermo (.com)

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
ASP.NET with FireFox - level 200

I'm a little slow on testing my ASP.NET apps with non-IE browsers, and it's because I used to be in an environment where I was writing internal web applications, and IE 5+ was mandated.  That took away headaches, but now I need to have ASP.NET apps that look good and function well in all the major browsers, so right now, that includes FireFox.  Although IE still has an overwhelming market share, in my opinion, the Internet savvy are split more evenly in browser usage.  There are tons of computers that don't get on the Net very often, and those all have IE, so I think it skews the numbers.

When testing my apps with FireFox, I noticed that ASP.NET was rendering for a down-level browser.  This is most likely because when .Net shipped, FireFox wasn't a major player, but now it is, and it supports all the high-level features, so it's necessary to add an entry to the <browserCaps/> section of the web.config.  Here is a page that can provide an applicable entry to make .Net render up-level to FireFox.

Some of the issues you will run into is that <div/> tags will be rendered as tables, and style percents will not be rendered at all.  It will dumb down the page to HTML 2.0.  Adding the <browserCaps/> section will cause the HTML rendered to be the same as that rendered to IE.  In IE, I use the style: TEXT-ALIGN:cetner to center contents of a div, but in FireFox, that doesn't work (it may be a standard thing, I'm not too sure), but doing <div align=“center“/> fixed the problem in both browsers.

I'm also using the XHTML doctype.  If you search newgroups, you'll find a lot of people poo-pooing xhtml as just a worthless fad, but if there is one and only one benefit (I'm sure there are more), it's that my CSS is truly cascading.  In HTML 4.0, I have to redeclare classes because the settings don't flow from the parent container to all children.  <td/> tags are notorious for this.


Posted 06-22-2005 9:56 AM by Jeffrey Palermo

[Advertisement]

Comments

Jeffrey Palermo wrote How to tag with Shadows.com - ASP.NET showcase
on 07-19-2005 12:56 PM
As I mentioned before, I'm at a new company, and I'm one of the .Net developers working on Shadows.com.&amp;nbsp;...
Jeffrey Palermo wrote How to ensure your web sites are valid Html (or XHtml) - level 300
on 07-29-2005 11:45 AM
I originally was going to label this post level 200, but given how few people know about Html standards,...
Randy Roach wrote re: ASP.NET with FireFox - level 200
on 02-27-2007 8:18 AM

Jeffrey,

First I just want to thank you for your service to the nation, both in Scouting and as a vet.

I work at the Boy Scouts of America National Office here in Irving, TX and we have a similar problem to yours.  In the past, we've done all our applications for internal use where we could mandate the use of IE.  Now we're looking expanding our services to the members, and we need our .NET apps to work on Firefox.

I'm a network security guy, not a programmer, but for some reason I've been asked to write a document for our developers to guide them in creating apps that will render properly on both Firefox and IE. Searching for that information lead me to your site. Do you know of any good reference material in this regard? Is there a site or book that would help?

Randy Roach

Sr. Network Analyst

Boy Scouts of America National Office

972-580-2536

rroach@netbsa.org

Jeffrey Palermo wrote re: ASP.NET with FireFox - level 200
on 03-01-2007 8:20 AM

Randy,

I'm not sure there is any one good reference.  You'd do well to cobble together information from the blogs of those who've done it.  The key to getting sites to work well is all browsers is to create a standard site.  What I mean is:

   * Always declare a <!DOCTYPE> (I use XHtml 1.0 Transitional)

   * Validate all pages : use w3c's validator.

   * Use standard CSS v1 or v2 - some browsers don't fully support v2.

   * Separate content from structure.

   * Ensure ASP.NET is rendering up-level markup in FireFox - learn about BrowserCaps and making ASP.NET recognize FireFox (and others) as up-level browsers.

   * Test, test, test.

--

Best regards,

Jeffrey Palermo, C# MVP, MCSD.Net

VP of Engineering, Vital Insight, Inc.