ASP.NET Interview question :- How do we write a HttpHandler ?

 Posted by articlesmaint on 2/24/2011 | Category: ASP.NET Interview questions | Views: 4693


This is a simple a .NET Interview question .Its a two step process.


First create a class which implements Ihttphandler

public class clsHttpHandler : IHttpHandler
{


    public bool IsReusable
   
{
        get { return true;
}
    }


    public void ProcessRequest(HttpContext
context)
    {
       // Put
implementation here.
    }
}


 


Step 2 make a entry in the web.config file.


 

<httpHandlers>
<add verb="*" path="*.gif"
type="clsHttpHandler"/>
</httpHandlers>



 


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response