Get base url in dev and production environment
<p>I'm using MVC3 and building an a tag (link) using jquery.  The problem is I can only get my links to work in either prod or dev, not both.  Here is my site's url in production.</p>

<p><a href="http://tvap.mydomain.com" rel="nofollow">http://tvap.mydomain.com</a></p>

<p>This is my development url.
<a href="http://localhost/TVAP" rel="nofollow">http://localhost/TVAP</a></p>

<p>So, I have a link that I'm creating via jquery as follows.</p>

<pre><code>  var actionCell = $('#itemlist').find(rowId).find(actionCellId);
  $('&lt;a&gt;Edit&lt;/a&gt;').attr({ 'id': 'edit-' + response.id, 'href': '/Items/Edit/' + response.id }).appendTo(actionCell);
</code></pre>

<p>In production, this works, and creates a link as</p>

<pre><code> &lt;a id="edit-17" href="/Items/Edit/17"&gt;
</code></pre>

<p>But in development (local) it doesn't work as I need this.</p>

<pre><code> &lt;a id="edit-17" href="/TVAP/ItemManagement/Edit/17"&gt;
</code></pre>

<p>I get the following from </p>

<pre><code> $(location).attr('host') ==&gt; localhost
 $(location).attr('host') ==&gt; http://localhost/TVAP/Items/Index
</code></pre>

<p>Either too little, or too much info.  I'd know I can check for localhost and append TVAP as needed, but this seems like a hack.  Another developer may use the ASP.NET VS dev server and get a URL will contain localhost but without the TVAP as I'm getting.
i.e. - <a href="http://localhost:64301/Items/Index" rel="nofollow">http://localhost:64301/Items/Index</a></p>
