سؤال

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