<img alt="Picture Display" src="<%= Url.Content("~/images/1.jpg")" />
this solved my problem
Pergunta
I am new to mvc. I have created one web application in asp.net-mvc-2.
src="../../images/1.jpg"
This is working when I debug from project but it is not loading from iis. Can anybody help me?
Solução 2
<img alt="Picture Display" src="<%= Url.Content("~/images/1.jpg")" />
this solved my problem
Outras dicas
I will suggest you to use UrlHelper.Content Method, It converts a virtual (relative) path to an application absolute path.
Example
@Url.Content("~/images/1.jpg")
Here The ~
character matches the root of the site /.