I am looking how to detect IE7
and IE8
browser in MVC4
, how to do that?
I find the property Request.Browser
but it do not gives any information about browser.
ASP. NET 4.x In ASP.NET MVC 4 Models and Data Access Hands-on Lab, you have been loading and displaying data from the database. In this Hands-on Lab, you will add to the Music Store application the ability to edit that data.
Lastly, you will let users delete an album and also you will prevent them from entering wrong data by validating their input. This Hands-on Lab assumes you have basic knowledge of ASP.NET MVC. If you have not used ASP.NET MVC before, we recommend you to go over ASP.NET MVC Fundamentals Hands-on Lab.
You can add validation to the application by adding Data Annotations to your model class. Data Annotations allow describing the rules you want applied to your model properties, and ASP.NET MVC will take care of enforcing and displaying appropriate message to users.
I advise you to use Contains method on Request.UserAgent
if (Request.UserAgent.Contains("MSIE 7.0"))
{
// Internet Explorer 7
}
else if (Request.UserAgent.Contains("MSIE 8.0"))
{
// Internet Explorer 8
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With