Use Code Determine the browser version used by the client
Response. Write (request. servervariables ["http_user_agent"]); (it seems that this is also available on ASP)
Or
Response. Write (request. useragent );
I have IE7 output:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; se 1.x;. Net CLR 2.0.50727;. Net CLR 3.0.04506.648;. Net CLR 3.5.21022; se 1.x)
Google browser output:
Mozilla/5.0 (windows; U; Windows NT 5.1; en-US) applewebkit/532.0 (khtml, like gecko) Chrome/3.0.195.38 Safari/532.0
write a public method call in the background (must be referenced) copy Code the code is as follows: public static int getbrowser ()
{< br> string browserinfo = httpcontext. current. request. useragent;
If (browserinfo. contains ("MSIE 7.0")
{// IE7
return 1;
}< br> else if (browserinfo. contains ("MSIE 6.0")
{// IE6
return 2;
}< br> else if (browserinfo. contains ("Firefox")
{// IE6
return 3;
}< br> else if (browserinfo. contains ("Chrome")
{// Google
return 4;
}< br> return 5;
}