The life of an ASP.NET Request
page 4 of 5
by . .
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 21023/ 27

Injection Points

Injection Point #1 - HTTP Modules

HTTPModules are classes that examine and modify HTTP Requests as they come through. When you register a new one for your application you can get it to do stuff. For example, you can use set event handlers for it's events like BeginRequest and EndRequest to take a look a system resources before and after the request has passed or measure the time it takes to process a request.

Also, because you get passed an HTTPApplication object, you can look at and modify objects that you are already used to like the Response and Request objects.

See the Related Articles for more information on HTTPModules.

Injection Point #2 - HTTP Handlers

Not all request are processed by all of the HTTPHandlers that you have defined. Usually you define a new extention in IIS that gets passed to the ASP.NET ISAPI Filter and then handle that specific extension in your handler or you can use existing ones.

You get passed in an HTTPContext object and then can use that to modify the request and response. HTTP Handlers can also be deployed as files with the .ASHX extension which makes them easier to deploy.

The uses of an HTTPHandler may include checking the client browser to determine if they can support something and then terminating the request if needed. This is easier than coding this into the aspx file because this way it just takes one line of code in web.config.

See the Related Articles for more information on HTTPHandlers.


View Entire Article

User Comments

Title: very useful   
Name: Kaja Moinudeen
Date: 2004-09-29 3:12:44 AM
Comment:
This articles gives a very good picture ofthe asp.net processes.
Excellent

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-29 10:21:55 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search