Вопрос

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)
    {
    }
}
Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top