title: How do I have a RedirectToAction within a void function
body: <p>In my code, I am calling a function, which does some validation checks against the database and if they fail, it should send the user to the "Access Denied" page ... but doesn't seem to work.</p>
  
  <p>Previously, the redirect would been with Server.Transfer or Response.Redirect, but not sure how you achieve the correct effect, with MVC.</p>
  
  <p>Simplified, my code looks like this and any help would be appreciated</p>
  
  <pre><code>private void CheckSecruity()
  {
      // secruity checks here
      if (failCheck)
          RedirectToAction("NoAccess", "MyController");
  
      // if code gets here, security was passed
  }
  
  public ActionResult MyPage()
  {
       // Call Security Function
       CheckSecruity();
  
       /*
         Do normal code
       */
  
       // Display page
       return View();
  }
  </code></pre>
  
  <p>When running the code drops into the CheckSecurity() function, but regardless of the code in there, it <strong>always</strong> shows MyPage</p>