What is an HttpHandler in ASP.NET

In the simplest terms, an ASP.NET HttpHandler is a class that implements the System.Web.IHttpHandler interface. ASP.NET HTTPHandlers are responsible for intercepting requests made to your ASP.NET web application server. They run as processes in response to a request made to the ASP.NET Site. The most common handler is an ASP.NET page handler that processes .aspx … Read more

Filehandler in asp.net

Create an ASHX (faster than aspx onload event) page, pass a the id of the file as a querystring to track each download public class FileDownload : IHttpHandler { public void ProcessRequest(HttpContext context) { //Track your id string id = context.Request.QueryString[“id”]; //save into the database string fileName = “YOUR-FILE.pdf”; context.Response.Clear(); context.Response.ContentType = “application/pdf”; context.Response.AddHeader(“Content-Disposition”, “attachment; … Read more