40

I am logging errors on my asp.net-mvc site and I wanted to see if there is anyway to detect the users browser info (name, version, etc) as it seems like people are getting issue but its because they are using very old browser. This info would help me avoid debugging time if I know they are using a "Not supported" browser.

BWA
  • 5,672
  • 7
  • 34
  • 45
leora
  • 188,729
  • 360
  • 878
  • 1,366

2 Answers2

68

You can get the supplied User Agent which gives browser information:

Request.UserAgent

There is a site which lists browser user agent strings: http://www.useragentstring.com

Other values you may be interested in.

Request.Browser.Platform
Request.Browser.Version
Request.Browser.EcmaScriptVersion
Fosco
  • 38,138
  • 7
  • 87
  • 101
40

You may try the Request.Browser property. It will contain pretty much everything you might need about the client browser (assuming it is sending the UserAgent header properly of course).

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928