Asp.net MVC different routes cause relative addressing issues
<p>I'm having an issue where im reusing partial controls in my asp.net mvc project. The situation is that we the website can be accessed from 2 different paths: e.g. </p>

<ol>
<li><code>http://localhost/mywebsite</code></li>
<li><code>http://localhost/mywebsite/app/otherapp</code></li>
</ol>

<p>These two address share controls and on those shared controls there are some img html tags with relative addressing throughout.</p>

<p>i.e. </p>

<p>This relative image address works fine for address web address 1 but fails for web address 2. To get it working for web address 2 i need to change it to </p>

<p></p>

<p>I've got these throughout the entire system and it would be a nightmare to go through and switch them at runtime.</p>

<p>Wondering if there is someway to cover this situation without all the hassle?</p>