I have an ASP.NET MVC page, where I am trying to show friendly URL\'s.
So, I have a Category View in the Home Controller, that accepts a categoryKey value to get the
This works too.
<img src="@Url.Content("~/Images/yourimage.png")"/>
You can use the relative path " ~/ " to refer to the current virtual directory where the page is located. Try to add runat="server" attribute to your "img" tag and "~" sign in "src" attribute:
<img runat="server" src="~/AdminUploadContent/bikes.gif" alt="Bikes" />
You can implement a custom http module that will rewrite path from the relative ../../img.png to needed handling the Referer http header, for instance.
Use the Url.Content method when generating a path to your image.
<img src="@Url.Content("~/AdminUploadContent/bikes.gif")" />
or if using the WebForms view engine:
<img src="<%= Url.Content("~/AdminUploadContent/bikes.gif") %>" />