title: MVC 5 C# Paths change after publishing asp.net project
body: <p>So this is going to bed a dumb question because I understand there is a simple solution, I just cannot figure it out....</p>
  
  <p>At the moment I am running my MVC 5 project in visual studio 2013... Normally when I want to debug it I will just click run and the website will appear in the browser of my choice...</p>
  
  <p>I just recently published it to my companys web server and now I am having all kinds of issues...</p>
  
  <p>The website is just 15 buttons on the Home/Index page and I want to be able to click on the buttons and still run them on my localhost side and when I publish them, still have them find the right path..</p>
  
  <p>Here is an example because I am not very good at explaining things...
  I run it in visual studio my url is: </p>
  
  <pre><code>http://localhost:54641/Home/Index
  </code></pre>
  
  <p>I run my published site on the webserver my url is: </p>
  
  <pre><code>http://webserver/racklabels/dakkota/Home/Index
  </code></pre>
  
  <p>I understand this part, and in either case both of them work but when it comes to clicking on a button, or images.. the pathing is all weird and I dont understand it.</p>
  
  <p>In visual studio I click my first button and my url becomes: </p>
  
  <pre><code>http://localhost:54641/RecieveTruck/AddFor
  </code></pre>
  
  <p>On my webserver I click it and it turns to: </p>
  
  <pre><code>http://webserver/RecieveTruck/AddFor
  </code></pre>
  
  <p>but gives me the 404 error because it is not the correct route ( which should be.. </p>
  
  <pre><code>http://webserver/racklabels/dakkota/RecieveTruck/AddFor
  </code></pre>
  
  <p>)</p>
  
  <p>This is how I have my button setup in my View (Index.cshtml) and I am wondering if this is what is causing the probelm (I am thinking that I may have to do it a different way other than using onclick)</p>
  
  <pre><code>&lt;input type="button" name="receive" value="Receive Truck" style="cursor: pointer;" class="bodyText"
      onmouseover="this.style.color='orangered';" onmouseout="this.style.color='black';"
      onclick="document.location.href='/RecieveTruck/AddForm';"&gt;
  </code></pre>
  
  <p>Basically I would like for this to work regardless of how many folders I am deep after I publish it and when I click run in visual studio (so I can debug/test and just republish to the webserver when I want to update) </p>
  
  <p>I have tried many different ways of sending the path... like '~/RecieveTruck/AddForm' (which just adds the ~ to the address) and '../RecieveTruck/AddForm' and just 'RecieveTruck/AddForm' but none of them find the actual root of where the project lives and just adds this to it...</p>
  
  <p>Can anybody help me?</p>