How can I display image from database in asp.net mvc. I created image table and image path as varchar

103

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");
    }

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>

Comments

Submit
0 Comments