Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It does sound like you are whitelisting browsers, which is not a good idea. You really need to do client-side detection of capabilities instead, generally. MVC really does not know what browser it is, the Request.Browser object can give you some idea, but that is not really reliable, which is the case for IE 11. It tells me version 11 on my dev machine, but 7 on my server, which can be a catastrophic mistake.</p> <p>I build Single Page Applications and have adopted a similar attitude as Google about only supporting the current and previous version of a browser only. When I detect an outdated browser I server a 'core' site that is just some basic CSS and markup, no JavaScript. It is just easier that way, makes development so much easier.</p> <p>Anyway the way I detect is to test for the current versions of IE like so:</p> <pre><code> public static bool IsModernIE() { return HttpContext.Current.Request.Browser.Browser == "InternetExplorer"; } </code></pre> <p>It is an HTML helper method. So in your cshtml you can use the test. In my controller I call the individual version tests. This is ultimately a very fragile way to do it. I am basically drawing a line in the sand between modern IE (10/11) and old IE (9-). This test could be irrelevant with the next version and I have not tested against say Xbox One yet.</p> <p>I have a library I use, posted on GitHub. I would call it usable Alpha right now, so take it for that and run with it if you like. I want to make the tests more externally configurable, etc. here is the URL for the repository, <a href="https://github.com/docluv/SPAHelper" rel="nofollow">https://github.com/docluv/SPAHelper</a>. I actually use it on my Blog, <a href="http://love2dev.com" rel="nofollow">http://love2dev.com</a>. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload