Showing an image after laoding 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:07 UTC
Read the original article
Hit count: 146
asp.net-mvc-2
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 wont work,but if i cut out the parameter int id1 and i instantiate it as a variable it'l work.
public FileContentResult GetFile() { int idl = 32; SqlDataReader rdr; byte[] fileContent = null; ........... return File(,,); }
Why?
© Stack Overflow or respective owner