// in u controller, you can do this
public ActionResult Show( int id )
{
byte[] Filecontent1 = null;
foreach (byte[] Filecontent in db.ExecuteStoreQuery<byte[]>
("select Filecontent from [barcodes] where Barcode_Id = @p0 ", id))
{
Filecontent1 = Filecontent;
}
var imageData = Filecontent1;
return File( imageData, "image/jpg" );
}
// Put this into consideration // automatically intercepts the Actionresult show
<tr><img src='<%= Url.Action("Show", "contollername",new {id = Model.itemid }) %>' /></tr>
id is required from url: http: // localhost // page / 1
where 1 is itemid
source
share