asp based browser sniffer that detects if browser supports css

Discussion in 'ASP General' started by AMC, Jan 12, 2005.

  1. AMC

    AMC Guest

    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
    AMC, Jan 12, 2005
    #1
    1. Advertising

  2. AMC

    Guest

    AMC wrote:
    > 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.
    , Jan 12, 2005
    #2
    1. Advertising

  3. AMC

    AMC Guest

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

    <> wrote in message
    news:...
    >
    > AMC wrote:
    > > 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.
    >
    AMC, Jan 12, 2005
    #3
  4. AMC wrote:
    > 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
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jan 12, 2005
    #4
  5. AMC

    AMC Guest

    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?

    "Bob Barrows [MVP]" <> wrote in message
    news:eOBLNOO%...
    > AMC wrote:
    > > 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
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    AMC, Jan 12, 2005
    #5
  6. Not that I know of.


    AMC wrote:
    > 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?
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:eOBLNOO%...
    >> AMC wrote:
    >>> 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
    >> --
    >> Microsoft MVP - ASP/ASP.NET
    >> Please reply to the newsgroup. This email account is my spam trap so
    >> I don't check it very often. If you must reply off-line, then remove
    >> the "NO SPAM"


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jan 12, 2005
    #6
  7. AMC

    Adrienne Guest

    Gazing into my crystal ball I observed "AMC" <>
    writing in news:#70j2JO#:

    ><> wrote in message
    > news:...
    >>
    >> AMC wrote:
    >> > 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.
    >>

    > 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.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, Jan 12, 2005
    #7
  8. AMC

    Roland Hall Guest

    "AMC" wrote in message news:OI2ihXN%...

    : 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
    Roland Hall, Jan 13, 2005
    #8
  9. Roland Hall wrote:
    > "AMC" wrote in message news:OI2ihXN%...
    >
    >> 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


    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
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jan 13, 2005
    #9
  10. AMC

    Roland Hall Guest

    "Bob Barrows [MVP]" wrote in message
    news:%23gljWqW%...
    : Roland Hall wrote:
    : > "AMC" wrote in message news:OI2ihXN%...
    : >
    : >> 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
    Roland Hall, Jan 13, 2005
    #10
  11. Roland Hall wrote:
    > "Bob Barrows [MVP]" wrote in message
    > news:%23gljWqW%...
    >> Roland Hall wrote:
    >>> "AMC" wrote in message
    >>> news:OI2ihXN%...
    >>>
    >>>> 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.


    Hmm - I copied it directly out of my address bar, but you're right. When I
    used the link to go back, I saw the 404. I had to drill down into the TOC to
    find it again. Expand the "Property and Method Guide node.

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

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jan 13, 2005
    #11
  12. AMC

    Guest

    AMC wrote:
    > Thanks, but how do I tell based on the version and type if css is

    supported?
    >
    > <> wrote in message
    > news:...
    > >
    > > AMC wrote:
    > > > 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.


    Look at the specs of each browser version in the documentation for that
    browser.
    , Jan 13, 2005
    #12
  13. AMC

    Roland Hall Guest

    "Bob Barrows [MVP]" wrote in message
    news:%23e2Jxca%...
    :
    : 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
    Roland Hall, Jan 13, 2005
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    34
    Views:
    1,778
    Joachim Schmitz
    Feb 14, 2009
  2. Junkone

    ruby based mysql sniffer

    Junkone, Sep 5, 2008, in forum: Ruby
    Replies:
    2
    Views:
    139
    Phlip
    Sep 5, 2008
  3. Matthew
    Replies:
    3
    Views:
    86
    kaeli
    Dec 4, 2003
  4. Replies:
    2
    Views:
    121
    Richard Cornford
    Jun 16, 2005
  5. Amanda H.
    Replies:
    4
    Views:
    108
    Amanda H.
    Feb 11, 2006
Loading...

Share This Page