Reputation: 33
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.
Upvotes: 2
Views: 5079
Reputation: 952
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?
Upvotes: 2