gridview in rowdatabount inside how to pass session value?

Posted by Chandru_ra under Regular Expressions on 7/28/2011 | Points: 10 | Views : 2361 | Status : [Member] | Replies : 4
Dear all,

am using in gridview. this gridview using bind and display value., now one picture pass the session how?

am using for rowdatabound..
this coding am using:

if (e.Row.RowType == DataControlRowType.DataRow)
{
Image imgPhoto = (Image)e.Row.FindControl("imgPhoto");
Session["imgPhoto"] = imgPhoto.ToString();
}

Advance Thanks to all

chandru


Responses

Posted by: Gsudhesh on: 7/28/2011 [Member] Starter | Points: 25

Up
0
Down
covert the Image to Binary format and then store it in session with the Image format.

then convert the Session data from Binary to Image format

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chandru_ra on: 7/28/2011 [Member] Starter | Points: 25

Up
0
Down
hi,
tell me any example..


chandru

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gsudhesh on: 7/28/2011 [Member] Starter | Points: 25

Up
0
Down
public byte[] imageToByteArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms,System.Drawing.Imaging.ImageFormat.Gif);
return ms.ToArray();
}


how to call the above method :

Session["imgdata"]=imageToByteArray(imgphoto);

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chandru_ra on: 7/28/2011 [Member] Starter | Points: 25

Up
0
Down
hi,
tell me assembly reference or name space

chandru

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response