Hello everyone!
I would like to know if there is a way to pass the Id value for an image in gridview through Session to an ashx file....
Here is my vb code in Gridview1_Rowdatabound event
if e.row.rowtype=datacontrolrowtype.datarow then
dim image as system.image.web.ui.webcontrols.image=ctype(e.row.findcontrol("imgphoto"),system.image.web.ui.webcontrols.image)
session("passid")=val(databinder.eval(e.row.dataitem, "id"))
image.imageurl="showimage.ashx"
And here is my showimage.ashx code
dim cmd as new sqlcommand("select * from table where id=@id",con)
dim imageid as new sqlparameter ("@id", system.data.sqldbtype.int)
imageid.value=context.session("passid")
cmd.parameters.add(imageid)
But this does not seem to work, as the session value is shown as O everytime...
Please help.....
Thanks.......!