If I have a url like "/something/something/" and my site is http://mysite.com and I want to link to that something url, is there a method like Url.Content(); which will discover the virtual directory of the site in IIS and map appropriately to a url path?
I tried Url.GenerateContentUrl(), Url.Action(), Url.Content(), Url.RouteUrl()
Why like when there is
Url.Content?which will take care of the virtual directory name and if your side is deployed at the root
http://example.comit will return/something/somethingand if you have a virtual directoryhttp://example.com/applicationnameit will return/applicationname/something/something.So everytime you need to link a static resource you should always use
Url.Content. For example:will always correctly resolve the image url no matter where your site is deployed to.