0

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.......!

2
Contributors
1
Reply
11
Views
4 Years
Discussion Span
Last Post by LastMitch
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.