I want to implement HTTPHandler in my ASP.NET project. I followed the link to do so I created a folder named App_code in my root. I had written a class MyHTTPHandler, it is reusable property, I also handles the process
public class HelloWorldHandler: IHttpHandler {public HelloWaldHandler {} Public Zero Process Request (HttpContext Reference) { Context.Response.ContentType = "text / flat"; If (context.Request.RawUrl.Contains (".cspx")) {string newUrl = context.Request.RawUrl.Replace (".cspx", ".aspx"); Context.Server.Transfer (NEWURL); }} Public Bull IRAULAB to enable publicing {// It holds handlers in memory {return is false; }}} The handler is not frying as I'm new to ASP.Net, I do not understand what's going wrong. I also entered the part of the web which is the web. Required in config. I went through several links, some say that there is a need to copy the code in IIS. I am not able to understand it. There is no need for any set up in IIS, as long as you do not want to handle some path, please advise
& lt; HttpHandlers & gt; Add section to web.config: & lt; Configuration & gt; ... & lt; System.web & gt; ... & lt; HttpHandlers & gt; & Lt; Verb = "*" path = "HelloWaldhandler.Shex" type = "namespace name.HelloWorldHandler, web applicationsname" /> & Lt; / HttpHandlers & gt; ... & lt; /system.web> ... & lt; / Configuration & gt; Here HelloWorldHandler.ashx is a path that you need to use to fire the handler, Namespace.name.HollowWorldHandler A full name is the handler class, including all namespaces, and WebApplicationName the name of the assembly handler. Has been implemented in
No comments:
Post a Comment