Detect user Browser and Operating System version in ASP.NET is very simple using the C# code:
This code retuns the HttpBrowserCapabilities class that has the information we desire.
Unfortunately the default Browser Caps configuration that come with ASP.NET 2.0 does not include browsers like Google Chrome and I could not find a way of getting the operating system version.
Finally I came up with solution that solve my problem as describe below:
- On my ASP.NET application I open new ASP.NET folder: App_Browsers.
- I download updated *.browser files that contain the information on the Google Chrome browser and also the operating system version and copy them to the App_Browsers folder. You can get the updated files from here.
I also attach small ASP.NET project that explain the solution. You can download it from here.
Enjoy Rotem 🙂