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: ASP.NET