Wednesday, July 7, 2010

How to find Browser type and version from code behind?

Copy paste below code in your code behind and see the out put!!!!!

string strBrowser= Request.Browser.Browser;//Display the browser type like IE, Mozilla etc.

string strBrowserVersion= Request.Browser.Version;//Display the browser version like IE 8.0,8.2 based on the release.

int intBrowserMajorVersion= Request.Browser.MajorVersion;//Display Browser major version like in IE 6,7,8

double dblBrowserMinorVersion= Request.Browser.MinorVersion;//Display Brwser Minor version like IE 1,2,3 based on the release.

No comments: