Using ASP.NET MVC3 with Razor & C#.
Say I have an application that is set up to run as a normal website through IIS, but now I want to run this application as a sub-application under another website. For example, the sub-application will be stored in a folder called "SubApp" off the root of the website (e.g. www.example.com/SubApp/).
If I reference a URL such as "~/Images/picture.gif" within SubApp's razor mark-up/code-behind, it will resolve to the root of SubApp: www.example.com/SubApp/Images/picture.gif
However, if I reference "/Images/picture.gif" through regular HTML (in SubApp), it will resolve to the root of SubApp's parent website: www.example.com/Images/picture.gif
Is there an easy, reliable way to resolve these HTML URLs to the sub-application's root without rewriting them to use Razor? What's the best way to handle URLs under these circumstances?