title: How does MVC4 detect a mobile browser?
body: <p>I've just followed Scott Hanselmans tutorial on <a href="http://www.hanselman.com/blog/MakingASwitchableDesktopAndMobileSiteWithASPNETMVC4AndJQueryMobile.aspx" rel="nofollow noreferrer">making a switchable site in MVC4.</a></p>
  
  <p>I'm using the Opera mobile emulator to test as I don't have VS2102. </p>
  
  <p>When rendering my page in the emulator <code>Request.Browser.IsMobileDevice</code> is false although it still renders the mobile view.</p>
  
  <p><img src="https://i.stack.imgur.com/UjNm9.png" alt="enter image description here"></p>
  
  <p>My questions are: </p>
  
  <ul>
  <li>Why/How does MVC4 decide to render the mobile view? It doesn't seem like it looks at <code>Request.Browser.IsMobileDevice</code>.</li>
  <li>Will the View Switcher be displayed on a real mobile device?</li>
  </ul>
  
  <p><strong>Edit:</strong></p>
  
  <p>I think I realised my mistake: </p>
  
  <p>To get it to work with the opera emulator I added a <code>MobileDisplayMode</code> as described here: 
  <a href="https://stackoverflow.com/questions/9614576/asp-net-mvc-4-mobile-features">ASP.NET MVC 4 Mobile Features</a></p>
  
  <p>It seems that that solution works with rendering correctly but <code>Request.Browser.IsMobileDevice</code> won't work. The same goes for <code>ViewContext.HttpContext.GetOverriddenBrowser().IsMobileDevice</code> is there a way to get around this?</p>