CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeffrey Palermo (.com)

Blog moved to www.jeffreypalermo.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.



Comments

Jeffrey Palermo said:

As I mentioned before, I'm at a new company, and I'm one of the .Net developers working on Shadows.com.&amp;nbsp;...
# July 19, 2005 12:56 PM

Jeffrey Palermo said:

I originally was going to label this post level 200, but given how few people know about Html standards,...
# July 29, 2005 11:45 AM

Randy Roach said:

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

# February 27, 2007 8:18 AM

Jeffrey Palermo said:

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.

# March 1, 2007 8:20 AM

About Jeffrey Palermo

Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. Jeffrey specializes in Agile coaching and helps companies double the productivity of software teams. Jeffrey is an MCSD.Net , Microsoft MVP, Certified Scrummaster, Austin .Net User Group leader, AgileAustin board member, INETA speaker, INETA Membership Mentor, Christian, husband, father, motorcyclist, Eagle Scout, U.S. Army Veteran, and Texas A&M University graduate. Check out Devlicio.us!

This Blog

Syndication

News

Headspring Systems

View Jeffrey Palermo's profile on LinkedIn

See my new blog at .jeffreypalermo.com