Jeffrey Palermo (.com)

Sponsors

The Lounge

Wicked Cool Jobs

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
How to render up-level html to FireFox from ASP.NET 1.1 - level 200
Out of the box, ASP.NET 1.1 doesn't recognize FireFox, but FireFox is now probably the second most popular browser behind IE.  IE still has the market, and if you are just checking IE, you probably won't feel any pain, but when developing an app for the Internet, you should make sure that your site works and looks good in the popular browsers. 

Since ASP.NET 1.1 doesn't recognize FireFox, the built-in WebControls will render down-level html.  What that means is that every <div/> tag will be replaced by a single-cell table, and a host of other changes.  This isn't good because it will distort the layout of your page.

The good news is that ASP.NET 1.1 can easily be told of the capabilities of other browsers through the web.config file.  You can customize the regular expression used to evaluate the User Agent string, but if you quickly need to support FireFox as well as IE, paste the following into your web.config within the <system.web/> node:

    <browserCaps>
            <case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+)(?'VendorProductToken' (?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)))?">
                browser=Gecko
                <filter>
                    <case match="(Gecko/[-\d]+)(?'VendorProductToken' (?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)))">
                        type=${type}
                    </case>
                    <case> <!-- plain Mozilla if no VendorProductToken found -->
                        type=Mozilla
                    </case>
                </filter>
                frames=true
                tables=true
                cookies=true
                javascript=true
                javaapplets=true
                ecmascriptversion=1.5
                w3cdomversion=1.0
                css1=true
                css2=true
                xml=true
                tagwriter=System.Web.UI.HtmlTextWriter
                <case match="rv:(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*))">
                    version=${version}
                    majorversion=0${major}
                    minorversion=0${minor}
                    <case match="^b" with="${letters}">
                        beta=true
                    </case>
                </case>
            </case>
        </browserCaps>


Posted Wed, Jun 29 2005 1:44 PM by Jeffrey Palermo

[Advertisement]

Comments

reteep wrote re: How to render up-level html to FireFox from ASP.NET 1.1 - level 200
on Thu, Jun 30 2005 5:24 AM
Hi Jeffrey,

I'm just curious if this counts for ASP.NET 2.0, too?

Thanks!
Jeffrey Palermo wrote re: How to render up-level html to FireFox from ASP.NET 1.1 - level 200
on Thu, Jun 30 2005 5:47 AM
I haven't explicitly tested it, but I've very confident that 2.0 knows about FireFox. Within a few months I'll be converting an app to 2.0, so I'll post my experiences.
Zhaph wrote re: How to render up-level html to FireFox from ASP.NET 1.1 - level 200
on Fri, Jul 1 2005 1:51 AM
Check out:
http://slingfive.com/pages/code/browserCaps/

This has a fairly complete overhaul of the Browser Caps section that includes a host of other browsers as well (Opera, Safari, etc).
Steve Reddoch wrote re: How to render up-level html to FireFox from ASP.NET 1.1 - level 200
on Mon, Jul 11 2005 7:50 PM
Hi,

This seems to work - sorta, but I have a bunch of stuff on my web site (www.ontime-technologies.com) that still does not render correctly. Any ideas?

sreddoch@ontime-technologies.com

thanks!
Jeffrey Palermo wrote How to tag with Shadows.com - ASP.NET showcase
on Tue, Jul 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;...
Rahul wrote re: How to render up-level html to FireFox from ASP.NET 1.1 - level 200
on Wed, Jan 9 2008 3:05 PM

Only first page getting displayed with links are not working.We have frames on default page they are not getting displayed.

Devlicio.us