mvc how to display an image, getting the path from the db code example
Example 1: How can I display image from database in asp.net mvc. I created image table and image path as varchar
public FileContentResult DisplayImage(string id)
{
byte[] image = repository.GetImage(id);
return File(image, "image/jpg");
}
Example 2: How can I display image from database in asp.net mvc. I created image table and image path as varchar
<td><img src="<%= Url.Action( "DisplayImage" , "User" , new { id = item.id} ) %>" alt="" /></td>