I have the following model:
public class Player
{
public String ImagePath
{
get
{
return \"~/Content/img/sql_error.JPG\
you can also try with this answer :
<img src="~/Content/img/@Html.DisplayFor(model =>model.ImagePath)" style="height:200px;width:200px;"/>
Try this ,
<img src= "@Url.Content(Model.ImagePath)" alt="Sample Image" style="height:50px;width:100px;"/>
(or)
<img src="~/Content/img/@Url.Content(model =>model.ImagePath)" style="height:50px;width:100px;"/>
@foreach (var m in Model)
{
<img src="~/Images/@m.Url" style="overflow: hidden; position: relative; width:200px; height:200px;" />
}
In your View try like this
<img src= "@Url.Content(Model.ImagePath)" alt="Image" />