Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Generic Handler in asp.net and its use?

Tags:

asp.net

I am new in asp.net. i want to know about the generic handlers in asp.net and how and where it use?

Could you help me?

like image 587
Vibin Jith Avatar asked Feb 25 '10 08:02

Vibin Jith


People also ask

Where we can define the generic handler?

Generic handler is a dynamic file and is generated with c# code and disk resource. Generic handler do not have web forms. Generic handler is also known as ASHX generic handler. It is useful when we want to return image from a query string,write XML and other Data.

What is the use of .ashx file in asp net?

What is an ASHX file? An ASHX file is a webpage that is used by the ASP.NET HTTP Handler to serve user with the pages that are referenced inside this file. The ASP.NET HTTP Handler processes the incoming request, references the pages from the . ashx file, and sends back the compiled page back to the user's browser.

What is a Web handler?

A Web Handler is a custom ABL class that inherits the OpenEdge. Web. WebHandler class and contains methods that enable you to handle REST requests. You use a Web Handler in a WEB transport service that you create.


2 Answers

Generic handlers are the .NET components that implement the System.Web.IHttpHandler interface. Any class that implements the IHttpHandler interface can act as a target for the incoming HTTP requests. Page is also generic handler. In general generic handlers have an extension of ASHX.

You can find example here

like image 124
Arsen Mkrtchyan Avatar answered Oct 27 '22 01:10

Arsen Mkrtchyan


Handlers are used when you want to avoid the overhead of a regular asp.net page. Practical examples include image processing or handling AJAX requests.

See Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components.

like image 29
The Scrum Meister Avatar answered Oct 26 '22 23:10

The Scrum Meister