blog post

The Browser property, which contains an HttpBrowserCapabilities object. This object gets information from the browser or client device during an HTTP request, telling your application the type and level of support the browser or client device offers. Different browsers and different versions of the same browsers support different features. In your application, you might need to determine what type of browser a user is viewing pages with, and perhaps determine if the browser supports certain features.

Source code

<pre class="html">
<%@ Page Language="C#" Title="Browser Capabilities" %>

<!DOCTYPE html>

<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {
        System.Web.HttpBrowserCapabilities browser = Request.Browser;
    string s = "<br />"
        + "Type = "                    + browser.Type + "<br />"
        + "Name = "                    + browser.Browser + "<br />"
        + "Version = "                 + browser.Version + "<br />"
        + "Major Version = "           + browser.MajorVersion + "<br />"
        + "Minor Version = "           + browser.MinorVersion + "<br />"
        + "Platform = "                + browser.Platform + "<br />"
        + "Is Beta = "                 + browser.Beta + "<br />"
        + "Is Crawler = "              + browser.Crawler + "<br />"
        + "Is AOL = "                  + browser.AOL + "<br />"
        + "Is Win16 = "                + browser.Win16 + "<br />"
        + "Is Win32 = "                + browser.Win32 + "<br />"
        + "Supports Frames = "         + browser.Frames + "<br />"
        + "Supports Tables = "         + browser.Tables + "<br />"
        + "Supports Cookies = "        + browser.Cookies + "<br />"
        + "Supports VBScript = "       + browser.VBScript + "<br />"
        + "Supports JavaScript = "     + 
            browser.EcmaScriptVersion.ToString() + "<br />"
        + "Supports Java Applets = "   + browser.JavaApplets + "<br />"
        + "Supports ActiveX Controls = " + browser.ActiveXControls 
              + "<br />"
        + "Supports JavaScript Version = " +
            browser["JavaScriptVersion"] + "<br />";

    lblbrowser.Text = s;
}
   
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div >
        <h2>Browser Capabilities</h2>
        <asp:Label ID="lblbrowser" runat="server" Text=""></asp:Label>
    </div>
    </form>
</body>
</html>

Detect Browser Types and Browser Capabilities in ASP.NET
  • Share This Story


Pleas give your valuable comments to improve the contents.

about author

Atul kumar shukla


I'm Atul Kumar Shukla, working as a web developer.
Welcome to my Blog. This is my personal blog where i post my own questions and answers , articles about ASP.Net., SQL Server, HTML, CSS, Jquery and many more..

Visit Profile

Comments (2)

  • Mark

    Thursday, 12 May, 2016 03:03 AM

    Nice

  • Shivam Deval

    Sunday, 23 August, 2015 02:05 PM

    Wow, that's great very informative site.

Leave a comment

Name
E-mail
Url
Message

Get More Stuff
Subscribing to the TheOneblogs newsletter and get intersting stuff and updates to your email inbox.
Your Email

 

Style Switcher

Change Color

×! We use cookies to improve your user experience. More information