title: How to remove hash parameters from url in ASP.NET controller in order to return to the root uri in an Angular.JS application?
body: <p>I am creating an Angular.JS page inside of an ASP.NET MVC5 C# application, and I would like to remove the # and trailing path from the URL on a new page load or browser page refresh.</p>
  
  <p>For example: <code>www.example.com/calculator#/step2</code> I would like it to go back to simply <code>www.example.com/calculator</code> on a page refresh. </p>
  
  <p>The idea is that I need it to start them back at the beginning of the calculator form on a new page load or a browser page refresh. The reason being is that the form I created does not persist the data between page refreshes, so they would need to refill in the data from the beginning.</p>
  
  <p>Whenever the page is reloaded, it does call my ASP.NET calculator controller, so my idea is that the server could reset the URL path?</p>
  
  <p>Inside of my ASP.NET calculator controller, I've got:</p>
  
  <pre><code>public class CalculatorController : Controller
  {
      // GET: Calculator
      public ActionResult Index()
      {
          // check for # sign and remove it and trailing path from URL.
          // or simply make the path "/calculator" every time.
          return View();
      }
  }
  </code></pre>
  
  <p>Is there an easy way to do this? I am new to Angular.JS so if there is an Angular.JS solution to this problem I would love to hear that as well.</p>