O'Reilly logo

Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB by Stefan Schackow, Bilal Haidar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.3. DefaultHttpHandler

All of the previous discussions have lead up to the need for some kind of "glue" that ASP.NET can use to pass data to classic ASP. The solution to this need is the DefaultHttpHandler class. In the previous examples, it was the DefaultHttpHandler that was responsible for passing the request back to IIS 7.0 whenever an ASP page was requested. Also, it was the DefaultHttpHandler that performed the various checks to ensure that the response had not been modified prior to either processing a POST request or passing control to classic ASP.

The DefaultHttpHandler runs during the handler execution phase of the ASP.NET HTTP pipeline. In other words, DefaultHttpHandler runs at the same point in time as the .aspx page handler; although instead of running an .aspx page, the DefaultHttpHandler deals with handing control to IIS 7.0. This means that the earlier events in the HTTP pipeline are available, and any of the logic associated with those events will run (for example, the FormsAuthenticationModule will run during AuthenticateRequest and so on).

The DefaultHttpHandler is configured in the root web.config file as shown here:

<add path="*" verb="GET,HEAD,POST"
 type="System.Web.DefaultHttpHandler" validate="True" />

Because this handler mapping is the second to last mapping, it means that any GET, HEAD, or POST request made to an ASP.NET application for a file type other than ones that are explicitly recognized by ASP.NET, will be routed to the DefaultHttpHandler

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required