title: Redirecting from cshtml page
body: <p>I want to redirect to a different view depending on the result of a dataset, but I keep getting returned to the page I am currently on, and can't work out why. I drop into the if statement the action gets called but once i return the view to the new page, it returns me back to the current page.</p>
  
  <p>CSHTML page</p>
  
  <pre><code>@{
  ViewBag.Title = "Search Results";
  EnumerableRowCollection&lt;DataRow&gt; custs = ViewBag.Customers;
  
  bool anyRows = custs.Any();
  if(anyRows == false)
  {
  
  
      Html.Action("NoResults","Home");
  
  
  }
  // redirect to no search results view
  </code></pre>
  
  <p>}</p>
  
  <p>Controller</p>
  
  <pre><code> public ActionResult NoResults()
      {
         return View("NoResults");
  
      }
  </code></pre>
  
  <p>View I cant get too..</p>
  
  <pre><code>@{
  ViewBag.Title = "NoResults";
   }
  
  &lt;h2&gt;NoResults&lt;/h2&gt;
  </code></pre>