Showing an image after loading it from sql database
- by user330075
I have a problem showing the image form database in a view Details and a ImageController. Inside the view I have:
img src=Url.Action("GetFile","Image", new {id= Model.id})
and in controller:
public FileContentResult GetFile(int idl)
{
//int idl = 32;
SqlDataReader rdr; byte[] fileContent = null;
...........
return File(,,);
}
When the view is called, function GetFile it just won't work. But if I cut out the parameter int id1 and I instantiate it as a variable it does work.
public FileContentResult GetFile()
{
int idl = 32;
SqlDataReader rdr; byte[] fileContent = null;
...........
return File(,,);
}
Why?