Author: you've been HAACKED | Posted on: 11/4/2009 5:18:30 PM | Views : 942

I saw a bug on Connect today in which someone offers the suggestion that the PageRouteHandler (new in ASP.NET 4) should handle IHttpHandler as well as Page . I don?t really agree with the suggestion because while a Page is an IHttpHandler , an IHttpHandler is not a Page . What I this person really wants is a new handler specifically for http handlers. Let?s give it the tongue twisting name: IHttpHandlerRouteHandler . Unfortunately, it?s too late to add this for ASP.NET 4, but it turns out such a thing is trivially easy to write. In fact, here it is. public class HttpHandlerRouteHandler<THandler> : IRouteHandler where THandler : IHttpHandler, new () { public IHttpHandler GetHttpHandler(RequestContext requestContext) { return new THandler...(read more) ...

Go to the complete details ...