title: Using multiple Views for the same page without code replication
body: <p>In MVC4 I am trying to show a <code>View</code> tailored to the environment that the end user is accessing it in. I am achieving this by accessing the <code>user agent</code> string and return the relevant <code>View</code>.</p>
  
  <p>Controller:</p>
  
  <pre><code>string userAgent = Request.UserAgent.ToLower();
  if (userAgent.Contains("ipad"))
  {
     viewPath = "~/Views/Home/Index.Ipad.cshtml";
  }
  else if (userAgent.Contains("android"))
  {
     viewPath = "~/Views/Home/Index.Android.cshtml";
  }
  else
  {
     viewPath = "~/Views/Home/Index.cshtml";
  }
  </code></pre>
  
  <p>The Android and iPad <code>Views</code> will not have major differences, meerly small adjustments to account for rendering differences. The main <code>Index.cshtml</code> will contain more data that the desktop screen will allow for.</p>
  
  <p>This will lead to a large amount of code replication. One change will need to be replicated across three <code>Views</code>. Is there an easier / better way to do this?</p>