display image in WebGrid if the image path stored in DB?

Nov 24 2015 8:03 AM
Hi,
I inserted image path into database and I want to retrieve that image into my view page. The table is binding with remaining columns but image is not displayed. How to display image in my WebGrid or Table.
I used this in my view page.
 
@grid.GetHtml(columns:
grid.Columns
(
grid.Column("Id", "Id"),
grid.Column("Name","Name"),
grid.Column("Photo", format: @<text><img src="/Images/@item.Photo" height="40px" width="40px" /></text>)
)
Here Images is the Folder name and I am inserting dynamic image from folder.I am using Asp.Net MVC with Entity Framework and SQL Server as Database.
Thanks in Advance. 

Answers (1)