I just created mvc 4 application. In that application I want to show alert,if user open this web application using Internet Explorer 6,7 and 8
This is the code I put top of "_Layout.cshtml" file
@if ((Request.Browser.Browser == "IE") & ((Request.Browser.Version == "8.0") | (Request.Browser.Version == "7.0") | (Request.Browser.Version == "6.0")))
{
<script type='text/javascript'>
alert("You're using older version of Internet Explorer")
</script>
}
But this is not checking internet explorer version , it gives me pop up for almost all the versions of Internet Explorer ( Edge(11) , 10 , 9 , 8 , 7, 6 )
How can I filter those versions separately
Try this-
Edit-
This checks if current version of IE is lower than 7.0, You can change the version number accordingly.
Edit 2- I just realized my browser was named as
InternetExplorer
, So I changed following-