1

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?

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

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

this solved my problem

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.