Hi All,
I am dynamically creating images and need to show those images to users. For that i have created a ashx file but the problem is this ashx file is never getting called not sure why path issue or need add any tags in web.config .. while debugging its not going .. might be its not finding please advice.
EDIT: When i directly hit the ashx url its going and showing some results
EDIT 1: Got to know that session is null in the context any reasone ?
or MVC asp.net don't require ashx handlers pelase advice. ' /// /// Summary description for $codebehindclassname$ /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class GetImage : IHttpHandler {
public void ProcessRequest(HttpContext context)
{
Log.Info(" In theGetImage");
context.Response.Clear();
byte[] imageByteArray = System.Convert.FromBase64String(context.Session["FrontJpegBase64"].ToString().Replace(' ', '+'));
// System.IO.MemoryStream imageMemoryStream = new System.IO.MemoryStream(imageByteArray);
try
{
using (System.Drawing.Image img = System.Drawing.Image.FromStream(new System.IO.MemoryStream(imageByteArray)))
{
img.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
catch (System.Exception ex)
{
}
finally
{
// img.Close();
context.Response.Flush();
}
}
public bool IsReusable
{
get
{
return false;
}
} `