I'm looking for how to detect IE7and IE8browser in MVC4, how to do it?
IE7
IE8
MVC4
I find the property Request.Browser, but it does not provide any information about the browser.
Request.Browser
I advise you to use the Contains method on Request.UserAgent
Request.UserAgent
if (Request.UserAgent.Contains("MSIE 7.0")) { // Internet Explorer 7 } else if (Request.UserAgent.Contains("MSIE 8.0")) { // Internet Explorer 8 }
Another option if you want <= 8:
Request.Browser.Browser == "IE" && Request.Browser.MajorVersion <= 8;