Reputation: 323
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?
Upvotes: 0
Views: 1198
Reputation: 323
<img alt="Picture Display" src="<%= Url.Content("~/images/1.jpg")" />
this solved my problem
Upvotes: 0
Reputation: 133403
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 /.
Upvotes: 1