Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Web;
- public class AlarmHandler : IHttpHandler
- {
- // Constructor.
- public AlarmHandler() { }
- public void ProcessRequest(HttpContext context)
- {
- HttpRequest Request = context.Request;
- HttpResponse Response = context.Response;
- // Test code.
- Response.Write("<html>");
- Response.Write("<body>");
- Response.Write("<h1>Hello from a synchronous custom HTTP handler.</h1>");
- Response.Write("</body>");
- Response.Write("</html>");
- }
- public bool IsReusable
- {
- get { return false; }
- }
- }
- <% @ WebHandler language="C#" class="AlarmHandler" codebehind="AlarmHandler.ashx.cs" %>
- <configuration>
- <system.webServer>
- <handlers>
- <add name="AlarmHandler" path="*.ashx" verb="*" type="IHttpHandler" />
- </handlers>
- </system.webServer>
- </configuration>
- <% @ WebHandler language="C#" class="AlarmHandler" codebehind="AlarmHandler.ashx.cs" %>
- <% @ WebHandler language="C#" class="Namespace.AlarmHandler" codebehind="AlarmHandler.ashx.cs" %>
- <add name="AlarmHandler" path="*.ashx" verb="*" type="Namespace.AlarmHandler" />
- <% @ WebHandler language="C#" class="AlarmHandler" %>
- using System.Web;
- public class AlarmHandler : IHttpHandler
- {
- // Constructor.
- public AlarmHandler() { }
- public void ProcessRequest(HttpContext context)
- {
- HttpRequest Request = context.Request;
- HttpResponse Response = context.Response;
- // Test code.
- Response.Write("<html>");
- Response.Write("<body>");
- Response.Write("<h1>Hello from a synchronous custom HTTP handler.</h1>");
- Response.Write("</body>");
- Response.Write("</html>");
- }
- public bool IsReusable
- {
- get { return false; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement