Showing an image after loading it from sql database

Posted by user330075 on Stack Overflow See other posts from Stack Overflow or by user330075
Published on 2010-05-01T07:03:15Z Indexed on 2010/05/01 7:27 UTC
Read the original article Hit count: 217

Filed under:

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?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2