title: Url.Content() not working on complex URLs
body: <p>I have <code>Url.Content()</code> snippets everywhere in my views. They work fine on pages with a simple URL, but not when the URL gets longer.</p>
  
  <p>Here's a sample:</p>
  
  <pre><code>&lt;img src="@Url.Content("~/Content/Images/logo.png")" id="logo"&gt;
  </code></pre>
  
  <p>This works fine when I'm on the homepage, or a page with URL <code>localhost:8080/s/chocolate</code> (which shows the result for the "chocolate" search.  </p>
  
  <p>But when I'm trying to add some refinements, e.g. <code>localhost:8080/s/chocolate/b/lindt</code> (which means filter the previous results to only ones from brand Lindt), it doesn't work anymore. In this case, <code>Url.Content</code> points to <code>/s/chocolate/Content/Images/logo.png</code>, which obviously fails.</p>
  
  <p>It's as if <code>Url.Content</code> only goes 2 levels up the current location instead of using the real root of the web app. I guess it makes sense in the convention that URLs are in the form <em>host/controller/action</em>, but here I have a more complex URL scheme (I use URL rewriter module to match these URL fragments to action's parameters).</p>
  
  <p>Is there any way to tell the helper to go to the real root, or any other solution to this problem?</p>
  
  <p>(BTW, I'm using MVC 4)</p>
  
  <p><hr />
  <strong>EDIT:</strong>
  As Felipe answered, I've just discovered that Url.Content is no longer necessary with MVC 4. That works for all "design" images with a constant path. However, I use a lot of images where the path is constructed partly with some data, e.g.</p>
  
  <pre><code>&lt;img src="@Url.Content(string.Format("~/Content/Images/stores/{0}.png", cart.Store.Retailer.Id))"/&gt;
  </code></pre>
  
  <p>I simply removed the Url.content, as such: </p>
  
  <pre><code>&lt;img src="@string.Format("~/Content/Images/stores/{0}.png", Model.PreferedCart.Store.Retailer.Id)"/&gt;
  </code></pre>
  
  <p>When rendered, this gives the following src: <code>~/Content/Images/stores_v2/Fr_SimplyMarket.png</code>. The <code>~</code> being still here, the image is not found. How can I fix that?</p>