title: MVC Redirect won't work if I call it outside the main function
body: <p>So, when I click a button - it hits submit. I manage to get the URL value fine. My issue is that hitting "RedirectingTime" function won't redirect the page. It just stops and displays a blank page. If I put it inside the Submit function then it works fine but I don't want to change my submit from a void to a redirect as I would like to also return a view if it errors.
  Thanks!</p>
  
  <pre><code>    [HttpPost]
      public void Submit(URLModel model)
      {
  
          string url = EmailEnd(model);
  
          if (url != "0")
          {
              RedirectingTime(url);
          }
          else
          {
              Error();
          }
      }
  
  
      public RedirectResult RedirectingTime(string url)
      {
          return Redirect(url);
      }
  
      public ActionResult Error()
      {
          return View();
      }
  </code></pre>
  
  <p>Based on the answer below - the working code is:</p>
  
  <pre><code>    [HttpPost]
      public ActionResult Submit(URLModel model)
      {
  
          string url = EmailEnd(model);
  
          if (url != "0")
          {
              return Redirect(url);
          }
          else
          {
              return View("Error");
  }
          }
          }
  </code></pre>