Question

I am creating one handler for processing image. When i try to request the url http://localhost/ProcessImage.ashx the ProcessRequest is getting invoked by default. This is not a Constructor. But how it is getting called by default?

public class ProcessImage : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
    }
}
Was it helpful?

Solution

You can look at the ASP.NET Application Lifecycle. For handlers (IHttpHandler), the implementation of the method ProcessRequest is called whenever you access/request for the handler.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top