Thursday, April 03, 2003 4:38 PM HomeSkillet

ASP.NET Web Controls and browserCaps

Today I needed the ASP.NET Panel web control to render as a html div element in Netscape 7.0 and Mozilla 1.0 (as opposed to a html table) for several different reasons that would take too long to detail here. Awhile back I found the following code snippet but unfortunately I can't recall exactly where I found it so I can't give due credit. Anywho, place the following snippet inside the <system.web></system.web> section of your web.config file. This will cause these browsers to essentially be treated as 'uplevel' browsers, thus rendering panels as div. On a related note, I thought that I had heard that the browserCaps would be updated periodically. Does anyone know how often this occurs and where I might be able to find an updated version?

<browserCaps>
  <case match="Gecko/[-\d]+">
     
browser=Netscape
     
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:1.0[^\.](?'letters'\w*)">
         
version=6.0
          majorversion=6
          minorversion=0
         
<case match="^b" with="${letters}">
             
beta=true
          
</case>
     
</case>
     
<case match="rv:1(\.\d+)(\.\d)?(?'letters'\w*)">
         
version=7.0
          majorversion=7
          minorversion=0
          
<case match="^b" with="${letters}">
              
beta=true
         
</case>
     
</case>
  </case>
</browserCaps>

Filed under:

Comments

# re: ASP.NET Web Controls and browserCaps

Thursday, April 03, 2003 4:32 PM by sirshannon

I read somewhere that the browser cap file is maintained by a third party, I can't remember who. I went to their site and they didn't have a version available, said they were currently updating it.
Before I realized that MS wasn't in charge of that file, I was pretty pissed at MS for incorrectly serving Netscape as a downlevel browser. I thought that MS sent out crappy CSS to Netscape (leaving out attributes that Netscape handles quite well) just so people would say "this looks bad in Netscape, Netscape sucks", when the reason it looks bad is because ASP.Net is sending bad HTML.
I am still not happy about this. MS has the resources to make this file themselves and the company that does it is producing a faulty product.

# browseCaps : Phil Scott's WebLog

Thursday, April 03, 2003 5:38 PM by TrackBack

browseCaps : Phil Scott's WebLog

# FYI: browsecap.ini re: ASP.NET Web Controls and browserCaps

Thursday, April 03, 2003 6:23 PM by cathal

the company that used to manage browsecap.ini is http://www.cyscape.com/, I don't know if they're supposed to supply this one.

# re: ASP.NET Web Controls and browserCaps

Friday, April 04, 2003 9:52 AM by Lance

FYI: Rather than putting that section in your web.config, I recommend maintaining browscap info in your machine.config.

C:\windows\Microsoft.NET\Framework\v1.0.3705\CONFIG\machine.config

if you check your current machine.config you will notice that this is where the current browser mappings are held. By putting it in the web.config you are merely overriding these settings for your 1 app.

This can be useful for control-library developers, but for GP I would recommend deferring to machine.config maintenance instead.

Regards,

Lance

# re: ASP.NET Web Controls and browserCaps

Thursday, June 19, 2003 12:51 PM by Mike

The browsercaps is supposed to be maintained here:
http://www.cyscape.com/browsercaps/

However, at the time of this writing it is "under development."

Mike

# re: ASP.NET Web Controls and browserCaps

Wednesday, July 23, 2003 4:33 PM by MJ

Can anyone expand on the topic of making the change above to the machine.config file?

Thanks!

# re: ASP.NET Web Controls and browserCaps

Monday, September 15, 2003 5:29 PM by Michael

CyScape's page has been "under development" since ASP.NET first came out. Given that they sell a product that competes directly with BrowserCaps I dont think this will ever chage. Why Microsoft noone else has picked up that challenge is a mystery to me.

# re: ASP.NET Web Controls and browserCaps

Monday, November 03, 2003 11:54 PM by WWB

Thanks for posting that code, it is a lifesaver.

Maybe the best plan would be to have someone slicker than regex than I make the default, catch-all thought to be an uplevel, rather than downlevel, browser. As there are really only 2 downlevel browsers of any weight floating about (older versions of IE and NS 4.xx), whereas most unrecognized stuff will be uplevel, at least insofar as standard webpages are concerned.

To put it in the machine.config, first find and backup the file on your web server (file is in %systemroot%\Microsoft.NET\Framework\%versionnumber%\CONFIG\) and paste the above code in between a few of the other <case>... statements about halfway down the (very long) file.

WWB

# re: ASP.NET Web Controls and browserCaps

Tuesday, November 04, 2003 9:06 PM by Homa

Thanks man. This saves my butt big time.

Happy Programming

Homa

# re: ASP.NET Web Controls and browserCaps

Wednesday, December 03, 2003 7:56 PM by Rob Eberhardt

Alright Mitch, so I was gonna post it all, but then it got too involved. The quick summary is that you inspired me to buckle down and do it better. :>

Thanks, and look at this new browserCaps section:
http://slingfive.com/demos/browserTools/

# re: ASP.NET Web Controls and browserCaps

Saturday, January 10, 2004 12:23 PM by D

Thanks for the help guys! You've all made what seemed to be a huge bug a simple fix for me.

# SezNet » Browser Caps

Saturday, February 21, 2004 12:05 AM by TrackBack

SezNet &raquo; Browser Caps

# re: ASP.NET Web Controls and browserCaps

Tuesday, March 09, 2004 7:07 AM by Tommi

Thanks, this was really good stuff :)!

# <SPAN>のstyle="width"とNetscape7.1

Friday, April 16, 2004 12:45 PM by TrackBack

<SPAN>?style="width"?Netscape7.1

# <SPAN>のstyle="width"とNetscape7.1

Friday, April 16, 2004 12:48 PM by TrackBack

&lt;SPAN&gt;?style="width"?Netscape7.1

# re: ASP.NET Web Controls and browserCaps

Friday, July 09, 2004 1:30 AM by Matt

Sweet!

Thanks

# BrowserCaps, aka Making ASP.NET Recognize That Gecko Variants Count.

Monday, July 19, 2004 10:09 PM by TrackBack

# BrowserCaps, aka Making ASP.NET Recognize That Gecko Variants Count.

Monday, July 19, 2004 10:10 PM by TrackBack

# Using other browers (Firefox) as High-Level in ASP.net

Thursday, August 19, 2004 11:44 AM by TrackBack

Using other browers (Firefox) as High-Level in ASP.net

# Firefox is actually a better browser than ASP.NET realizes

Thursday, September 16, 2004 5:26 AM by TrackBack

Firefox is actually a better browser than ASP.NET realizes

# Al&#8217;s Blog &raquo; Blog Archive &raquo; ASP.NET and Firefox

Sunday, November 26, 2006 4:33 PM by Al’s Blog » Blog Archive » ASP.NET and Firefox

# re: ASP.NET Web Controls and browserCaps

Sunday, July 15, 2007 3:52 AM by Mohit

Dynamic controls are overlapping in IE7.0

and fireox while best viewed in IE6.0

need urgent help.

Above code doesnt fix the problem.

# re: ASP.NET Web Controls and browserCaps

Friday, July 18, 2008 2:54 AM by nil karaibrahimgil

Thank you so much..

It's very useful!

King Regards!

# re: ASP.NET Web Controls and browserCaps

Thursday, July 31, 2008 1:30 AM by turkie

thanks docs perfect you

# ASP.NET and Firefox &laquo; The Codetripper

Wednesday, December 24, 2008 11:18 AM by ASP.NET and Firefox « The Codetripper

Pingback from  ASP.NET and Firefox &laquo; The Codetripper

# re: ASP.NET Web Controls and browserCaps

Friday, December 26, 2008 5:35 AM by Olgunka-al

<a href= membres.lycos.fr/maffals >genetic disorters</a>

# re: ASP.NET Web Controls and browserCaps

Friday, December 26, 2008 5:42 AM by elexx-vg

<a href= membres.lycos.fr/dertull >zx10r graphics</a>

# Browser ondersteuning ASP.NET &laquo; EMIEL VAN DER LINDEN&#8217;S WEBLOG

Pingback from  Browser ondersteuning ASP.NET &laquo;  EMIEL VAN DER LINDEN&#8217;S WEBLOG

# re: ASP.NET Web Controls and browserCaps

Saturday, February 28, 2009 10:37 PM by elexx-cc

<a href= adult-singles-finder.com >singles</a>

# Kerry D. Wong &raquo; Blog Archive &raquo; Supporting FireFox in ASP.Net

Pingback from  Kerry D. Wong  &raquo; Blog Archive   &raquo; Supporting FireFox in ASP.Net

# re: ASP.NET Web Controls and browserCaps

Wednesday, March 18, 2009 1:46 AM by venkatesh mndya

ya, i am facing same problem with firefox with displaced content in rendered UI, what is the root cause of this? Does it requires to configure both web.config and machine.config?

Leave a Comment

(required) 
(required) 
(optional)
(required)