Before loading a webpage I am detecting browser and version to determine compatibility.
So if the browser is less than IE7 I display an incompatible message.
Testing the webpage in IE11 my webpage is displaying the incompatible message.
I'm currently getting the browser name from:
var browser = Request.Browser.Browser;
and the version from
var version = Request.Browser.Version;
I then check that the browser is IE and the version >= 7.
I believe that the user agent has changed for IE11. So what is the best way to detect if the browser is >= IE7 using C#.
EDIT:
Request.Browser.Browser returns the browser name, e.g. IE. Request.Browser.Version returns the version number. I add these to a BrowserVersion object I have and compare these values to an array of supported browser versions that I have also. i.e.
private static List<BrowserVersion> m_supportedBrowsers = new List<BrowserVersion>()
{
new BrowserVersion("IE", 7),
new BrowserVersion("Firefox", 3),
new BrowserVersion("AppleMAC-Safari", 5),
new BrowserVersion("Safari", 5)
};
where BrowserVersion is just an object that has 2 string properties (name and version).
Request.Browser
works?