I need to get client stats for browser (not full long description but short names, generally firefox,ie6,ie7,ie8,safari,chrome,opera and mozilla). Client resolution and OS ie. Windows Vista, Ubuntu ....
thanks
I need to get client stats for browser (not full long description but short names, generally firefox,ie6,ie7,ie8,safari,chrome,opera and mozilla). Client resolution and OS ie. Windows Vista, Ubuntu ....
thanks
Share Improve this question asked May 24, 2010 at 7:51 eugeneKeugeneK 11.1k20 gold badges70 silver badges105 bronze badges1 Answer
Reset to default 7You can get the browser name using Request.Browser.Browser
. There's also a lot more in the Request.Browser
class that may be of interest:
var browserName = Request.Browser.Browser; // Would return IE, etc
var browserType = Request.Browser.Type; // Would return IE7, IE8, etc.
var browserMajor = Request.Browser.MajorVersion;
var browserMinor = Request.Browser.MinorVersion;
var supportsActiveX = Request.Browser.ActiveXControls;
var inputType = Request.Browser.InputType;
var supportsColours = Request.Browser.IsColor;
var isMobileDevice = Request.Browser.IsMobileDevice;
var supportsJavaApplets = Request.Browser.JavaApplets;
var ...
Because ASP.Net is a server side language, it has no visiblity of the client machine's OS settings. Therefor the only way to get the Client OS Resolution would be to use JS and pass the resolution back either as a URL parameter or within a hidden field:
var resolution = screen.width + ' x ' + screen.height;
hiddenField.value = resolution;