Question

I am new to mvc. I have created one web application in .

src="../../images/1.jpg"

This is working when I debug from project but it is not loading from iis. Can anybody help me?

Was it helpful?

Solution 2

<img alt="Picture Display" src="<%= Url.Content("~/images/1.jpg")" />

this solved my problem

OTHER TIPS

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 /.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top