title: How to detect "device mode" (MVC3 + Bootstrap)
body: <p>I'm working with MVC3 and Bootstrap Responsive, and I want to detect by Razor (or javascript) which mode is active (desktop, tablet or phone) to show the correct partial view in one case or another.</p>
  
  <p>For example:</p>
  
  <pre><code>@if( mode=='phone')
  {
      @html.Partial("_partialPhone")
  }
  @if( mode=='desktop')
  {
      @html.Partial("_partialDesktop")
  }
  ...etc
  </code></pre>
  
  <p>I don't want to use just  ".visible-phone" "visible-tablet" and ".visible-desktop" css classes, because although only one partial view is displayed, all of them are loaded in the DOM and rendered by Razor engine. And that is not good for a Phone and Tablet performance.</p>
  
  <p>Can anyone help me?</p>
  
  <p>Thanks</p>