asp based browser sniffer that detects if browser supports css

A

AMC

Hi,

I need to code an asp based browser sniffer. It needs to detect if a browser
can support css and if not redirect to a different site. Does anyone have
sample code that does this?

thx
 
L

larrybud2002

AMC said:
Hi,

I need to code an asp based browser sniffer. It needs to detect if a browser
can support css and if not redirect to a different site. Does anyone have
sample code that does this?

Retrieve the version and type of the browser and redirect based on
those values.
 
B

Bob Barrows [MVP]

AMC said:
Hi,

I need to code an asp based browser sniffer. It needs to detect if a
browser can support css and if not redirect to a different site. Does
anyone have sample code that does this?

thx
Do a quick Google for Browserhawk

Bob Barrows
 
A

AMC

Thanks, but I've looked at Browserhawk, and I need to write this myself
rather than purchase something, is there a list somewhere of browsers that
don't support css?
 
B

Bob Barrows [MVP]

Not that I know of.

Thanks, but I've looked at Browserhawk, and I need to write this
myself rather than purchase something, is there a list somewhere of
browsers that don't support css?
 
A

Adrienne

Thanks, but how do I tell based on the version and type if css is
supported?

You're probably worrying about older browsers like IE and Netscape 4,
right?

As long as your document can be read/accessed without a stylesheet, you can
just serve NS 4 plain text. The way to do this is to use an @media that is
not screen, like @media all, or you could combine both @media all and
@media screen in the same stylesheet and include styling for NS in the
@media screen section.

For IE, there are only a few things to remember:
1. IE does not recognize hover on any element other than A
2. IE does not recognize display:fixed because the only element that IE can
fix in the view port is the background of the body element.
3. IE does not do well with fonts in ems. Use percentages instead, and you
should be fine.

The other thing you need to do, if you are not already, is make sure that
you are using a Strict Document Type Declaration (DTD), which will force
compliant browsers (IE among them) into standards mode. However, doing so,
you must make sure the markup is valid, otherwise the browser will still go
into quirks mode and possibly make a mess of the invalid markup.
 
R

Roland Hall

in message
: I need to code an asp based browser sniffer. It needs to detect if a
browser
: can support css and if not redirect to a different site. Does anyone have
: sample code that does this?

ASP is server-side scripting. CSS is client-side and is rendered by the
user's browser. BrowserHawk I don't think determines CSS capabilities.

This article may help:
http://support.microsoft.com/default.aspx?scid=kb;en-us;272413

Which has a link to this to get an updated browscap.ini file:
http://www.cyscape.com/browscap/

However, the easiest way to test would be to set a style on your page and
test to see if it had been set.
http://kiddanger.com/lab/cssenabled.asp

If you are looking for certain CSS capabilities, then you'll need to test
for those specifically.

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
B

Bob Barrows [MVP]

Roland said:
in message

ASP is server-side scripting. CSS is client-side and is rendered by
the user's browser. BrowserHawk I don't think determines CSS
capabilities.

Using either an activex control or a class in .Net, it does report on this.
http://www.cyscape.com/docs/showhelp.asp?topic=About_The_Property_Reference_Guide


By suggesting the use of Browserhawk, I ws subtly hinting that this
capability could not be reliably determine in server-side code. Much too
subtly, i see now.

Bob Barrows
 
R

Roland Hall

in message
: Roland Hall wrote:
: > "AMC" wrote in message : >
: >> I need to code an asp based browser sniffer. It needs to detect if a
: >> browser can support css and if not redirect to a different site.
: >> Does anyone have sample code that does this?
: >
: > ASP is server-side scripting. CSS is client-side and is rendered by
: > the user's browser. BrowserHawk I don't think determines CSS
: > capabilities.
:
: Using either an activex control or a class in .Net, it does report on
this.
:
http://www.cyscape.com/docs/showhelp.asp?topic=About_The_Property_Reference_Guide

That topic doesn't appear to be available. I'm getting a 404.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
B

Bob Barrows [MVP]

L

larrybud2002

AMC said:
Thanks, but how do I tell based on the version and type if css is supported?

Look at the specs of each browser version in the documentation for that
browser.
 
R

Roland Hall

in message
:
: Or use this link:
: http://www.cyscape.com/docs/browserhawk/stylesheets_property.htm

Dayum. So much for looking. One day I will learn not to trust my lying
eyes.
Thanks Bob.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top