Many thanks given reply to me...........
Home.aspx
Session["id"] = 1;
Server.Transfer(@"Admin\AdminHome.aspx");
Showimage.ashx
public void ProcessRequest(HttpContext ctx)
{
SqlConnection con = new SqlConnection("user id=sa;password=sa@123;database=img;server=.;");
con.Open();
string x =ctx.Request.QueryString[0];
SqlCommand cmd = new SqlCommand("select image_data,image_contenttype from images where image_pk=" +int.Parse(x), con);
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
ctx.Response.ContentType = dr["image_contenttype"].ToString();
ctx.Response.BinaryWrite((byte[])dr["image_data"]);
dr.Close();
con.Close();
}
AdminHome.aspx
Image2.ImageUrl = "~/Admin/ShowImage.ashx?id=" + int.Parse(Session["id"].ToString());
source part of AdminHome.aspx
<asp:image id="Image2" runat="server" height="164px" width="176px" xmlns:asp="#unknown" />
Web.Config
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<urlMappings enabled="true">
<add url="~/AdminHome.aspx" mappedUrl="~/Admin/ShowImage.ashx"/>
</urlMappings>
</system.web>
it got Without any Error in this application....try it..........