Skip to main content

Posts

Showing posts with the label Generic Hander

ASP.net - Http handlers - Generic Hander

An HTTP Handler is a . NET class that executes whenever you make a request for a file at a certain path. Each type of resource that you can request from an ASP. NET application has a corresponding handler. When you request an ASP. NET page, the Page class executes. The Page class is actually an HTTP Handler because it implements the IHttpHandler interface. Other examples of HTTP Handlers are the TraceHandler class, which displays applicationlevel trace information when you request the Trace.axd page and the ForbiddenHandler class, which displays an Access Forbidden message when you attempt to request source code files from the browser. Similarly you can create your own HTTP handlers for acting on any requests received at webserver. Generic Hander Add a generic handler by right clicking on the project explorer > Add> new item> select Generic Handler. A new file with ASHX extension is created. Here is a sample code which I got from Steven Walthers book. This handler cr...