Retreive images thru ASHX (IHttpHandler)
contents of NWEmpPhoto.ashx
<%@ webhandler language="C#" class="NWEmpPhotoHandler" %>
using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
public class NWEmpPhotoHandler : IHttpHandler {
public bool IsReusable { get { return true; } }
public void ProcessRequest(HttpContext ctx) {
ctx.Response.ContentType = "image/bmp";
ctx.Response.OutputStream.Write(pict, 78, pict.Length - 78);
}
}


0 Comments:
Post a Comment
<< Home