Chapter 58: ASP Browser Capabilities Component

ASP Browser Capabilities Component

This is the lesson that appears in the W3Schools Classic ASP reference under ASP Components, and it was one of the coolest things for web developers in 1998–2005 because it let you automatically detect what kind of browser the visitor was using — and then show different content, layouts, or features accordingly.

I will explain it like your favorite teacher who actually used Browser Capabilities on real client sites in the early 2000s (when detecting Netscape 4 vs IE 5 vs mobile browsers was a daily headache) — slowly, clearly, with real working examples, good habits, common mistakes, why it became obsolete, and why some legacy Indian government/intranet/ERP systems still rely on it in 2026.

1. What is the Browser Capabilities Component?

The Browser Capabilities component (usually called browscap) is a built-in ASP component that reads the browser’s User-Agent string (sent automatically in every HTTP request) and tells you detailed information about the browser:

  • Name (IE, Netscape, Firefox, Chrome, Safari, Opera…)
  • Version number
  • Platform (Windows, Mac, Linux…)
  • Whether it supports:
    • Frames
    • Tables
    • JavaScript
    • VBScript
    • Cookies
    • ActiveX
    • Java applets
    • CSS
    • Background sounds
    • Channels (old push tech)
    • VB Script
    • And many other old-school features

It was extremely useful in the late 90s / early 2000s because:

  • Browsers behaved very differently (Netscape 4 vs IE 5 vs early mobile phones)
  • Web standards were weak → you had to serve different HTML/CSS/JS to different browsers
  • Mobile browsing was emerging (WAP, early PDA phones) → you needed to detect tiny screens, no JavaScript, etc.

2. How It Works — The Two Main Parts

  1. browscap.ini file A text file on the server that contains a huge list of User-Agent strings + capabilities. IIS reads this file to match the incoming User-Agent.
  2. BrowserType object In your ASP code, you create it with Server.CreateObject(“MSWC.BrowserType”) It automatically matches the current request’s User-Agent against browscap.ini and gives you properties.

Default location of browscap.ini (on Windows Server/IIS):

text

(or sometimes C:\inetpub\AdminScripts\browscap.ini)

Important: This file was regularly updated by Microsoft until ~2008–2010. After that, it became outdated very fast because new browsers (Chrome, mobile Safari, Firefox updates) were not added.

3. Basic Example – Detect Browser & Show Different Messages

asp

What you see (depending on your browser in 2026):

  • Browser: Chrome
  • Version: 130.0
  • Platform: Win32
  • Frames: Yes
  • Tables: Yes
  • Cookies: Yes
  • JavaScript: Yes
  • VBScript: No (Chrome never supported VBScript)

4. Real-World Example – Serve Different Content Based on Browser

asp

5. Security & Best Practice Warnings (Critical in 2026)

  • browscap.ini is outdated — Microsoft stopped updating it around 2008–2010 → Chrome, modern Firefox, Edge, Safari mobile, all new Android/iOS browsers → not recognized → Most properties return default/fallback values → unreliable
  • User-Agent can be faked — anyone can send any User-Agent string → Never use for security (e.g. “only allow IE” checks) → Only use for progressive enhancement (better experience if supported)
  • Do not rely on it for mobile detection — use modern methods (CSS media queries, JavaScript navigator.userAgent + feature detection)
  • In 2026 legacy code → still used in very old systems for simple “IE vs others” checks or logging, but almost never for real decisions

6. Teacher Summary – ASP Browser Capabilities Component in Classic ASP

ASP Browser Capabilities Component (MSWC.BrowserType) is:

  • A built-in COM object that matches the browser’s User-Agent string against browscap.ini
  • Gives you properties like Browser, Version, MajorVer, MinorVer, Platform, Frames, Tables, Cookies, JavaScript, VBScript, BackgroundSounds, etc.
  • Created with Server.CreateObject(“MSWC.BrowserType”)
  • Used for: serve different HTML/CSS/JS to old browsers, simple mobile detection (unreliable), logging browser stats
  • Was revolutionary 1998–2005 when browsers were very different
  • Very unreliable today because browscap.ini is frozen since ~2008–2010
  • Still exists in many legacy Indian internal/intranet/government/ERP systems for simple compatibility checks

This is how millions of Classic ASP sites tried to give “browser-specific experiences” — and some very old Indian systems still use exactly this BrowserType object pattern in 2026 (usually with sad results).

Next class?

  • Want a full example with different layouts for old IE vs modern browsers?
  • Or how to update/maintain browscap.ini manually (people did this)?
  • Or compare Classic ASP Browser Capabilities vs modern navigator.userAgent + feature detection?
  • Or move to the next W3Schools topic (ASP Content Linking or ASP Content Rotator)?

Just tell me — I’m here! 🚀🇮🇳 Keep learning strong, Webliance! 😊

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *