Question:
How does one deploy a HttpHandler in asp.net 2.0?
Updated Http Handler code (Inside App_Code):
namespace Samples
{
public class SampleHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
Updated Web.Config file
<system.web>
<httpHandlers>
<add verb="*" type="Samples.SampleHandler" path="*.js"/>
</httpHandlers>
</system.web>
aspx page
<script type="text/javascript" src="scripts/sample.js"></script>
as you see every javascript request must be routed to the http handler but it doesn't.
You may take a look at the following guide.