I'm trying to display an image in MVC by calling on a controller method in my view which returns the path of the image file to then be displayed.
Controller
static public string returnImgPath()
{
return "~/Users/orpi/Downloads/banff.jpg";
}
View:
<img src="@Url.Action("returnImgPath", "OUsersController")" alt ="Image"/>
I don't believe I can do this using Url.Content
because my model is based on a database using EF and so I can't use model functions/members to really do anything.