I support an ASP.NET MVC site that redirects users to an error page if they are on IE7 or earlier.
if (Request.Browser.Browser == "IE" && Request.Browser.MajorVersion <= 7)
{
return RedirectToAction("Browser","Error");
}
I now need to make a change to redirect users to an error page if they are using IE10 or earlier. I know that to detect IE8 I would simply need to check MajorVersion equal to 8, but I haven't been able to find documentation on using Request.Browser to detect IE9 and IE10.
Perhaps checking for MajorVersion being less than or equal to 10 is sufficient. However, I know for IE11, Request.Browser.Browser returns "InternetExplorer" rather than "IE", and I haven't been able to locate a definitive answer on what IE9 and 10 return for Browser. Also, with the trust issues IE has given me I don't feel safe assuming IE9 and 10 will set MajorVersion to 9 and 10. Does anyone know for certain what Request.Browser.Browser and Request.MajorVersion will contain for IE9 and 10?