title: iPhone iPad Not detecting the browser type in ASP.Net MVC app
body: <p>I have a web application which has alot of widgests/page in it. Certain widgets I want to block when opened in Safari and display some sort of message if anyone tries to open the webapp from Safari browser.
  Below is the code I have written.</p>
  
  <pre><code>  public class BlockFromSafari : System.Web.Mvc.ActionFilterAttribute
      {
          // runs just before the action is executed
          public override void OnActionExecuting(ActionExecutingContext filterContext)
          {
              var browserType = filterContext.HttpContext.Request.Browser.Browser;
              base.OnActionExecuting(filterContext);
              if (browserType.Contains("Safari"))
              {
                  // Redirect the user accordingly
                  filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary { { "controller", "Security" }, { "action", "Safari" } });
              }
          }
      }
  </code></pre>
  
  <p>Kindly note that I have applied this filter on the all the Action Method which I want </p>
  
  <pre><code>  public ActionResult Safari()
    {
              return Content("This is SAFARI!!");
    }
  </code></pre>
  
  <p>Current Behaviour: </p>
  
  <ol>
  <li><p>If I open the website and visit the corresponding URL, in Chrome in <em>WindowsPC</em> page opens fine, where as if I open in Safari Browser in Windows PC I get redirected to "This is SAFARI content page".</p></li>
  <li><p>If I open the website and visit the corresponding URL, in Chrome in <em>Mac PC</em> page opens fine, where as if I open in Safari Browser in Mac PC I get redirected to "This is SAFARI content page"</p></li>
  </ol>
  
  <p>So far so good.
  Now here is the problem</p>
  
  <p>Issue: If I open the website and visit the corresponding URL, in <strong>Chrome</strong> in <em>Mobile device</em> or <em>Ipad</em> page still displays "This is SAFARI" ideally I expected the same behaviour as in PC. Please guide me.</p>
  
  <p><strong>Expected Behaviour:</strong></p>
  
  <p>Mobile Device-Chrome - Should open fine</p>
  
  <p>Mobeil Devive-Safari - "This is SAFARI" should be displayed</p>
  
  <p><strong>Interesting Read</strong> <a href="https://stackoverflow.com/questions/46599548/why-iphone-treating-google-chrome-as-safari-also-mozilla-firefox-as-safari-brows">Chrome Treated as Safari</a></p>