2

My controller returns a string which is a url of an image. How do I display that url on the view in asp.net mvc 4

I guess it's something very straight forward but I can't find out how to do it.

2
  • 2
    Show you controller & view. Commented Feb 13, 2016 at 6:04
  • You should be more specific. Did you pass some model to your view? Commented Feb 13, 2016 at 17:42

1 Answer 1

2

You're not providing a lot of detail but if you have the image url in the controller you should be able to set it to a model property and then in the view use something like:

<img src="@Html.Raw(model.ImageUrl)" alt="a description of the image">

to use that url to display the image. Yes?

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

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.