foreach (DataRow dr in dt.Rows)
{
TextBox1.Text = (dr["Dname"].ToString());
TextBox2.Text = (dr["Dfamily"].ToString());
TextBox3.Text = (dr["Father"].ToString());
Session["ImageBytes"] =
ImagePreview.ImageUrl = "~/ImageHandler.ashx";
then in imagehandler.ashx
<%@ WebHandler Language="C#" Class="ImageHandler" %>
using System;
using System.Web;
public class ImageHandler : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest (HttpContext context) {
if ((context.Session["ImageBytes"]) != null)
{
byte[] image = (byte[])(context.Session["ImageBytes"]);
context.Response.ContentType = "image/JPEG";
context.Response.BinaryWrite(image);
}
}
public bool IsReusable {
get {
return false;
}
}
}