|
The
following is the process-flow for ASP.NET:
- User requests an ASPx page in his/her browser
- An HTTP request is sent to it.
- The xspisapi.dll isapi filter intercepts the request and passes
the request on to the XSP worker process (xspwp.exe)
- Xspwp takes care of handing the request to the appropriate HTTPModules
and finally an HTTPHandler as defined in the configuration files
- The ASPX page is read from the HD or cache and server code is loaded
into memory and executed
- The server side code outputs normal HTML which is handed back through
the chain of modules and eventually to IIS, which sends the response
back to the user's browser
- If the user clicks or otherwise acts on an HTML element (say, a
textbox) that has a server side event handler, the form is posted
back to the server with hidden form fields containing information
as to what control and event occurred. Some controls do not automatically
post by default, but wait for a button_click event to post. (This
is configurable by the developer.)
- The ASPx page is again loaded into memory using the same sequence
of events as before, but this time ASP.net reads in the hidden
form field data and automatically triggers the appropriate _OnChange,
OnClick and other appropriate event handlers.
- Resulting HTML is sent to the browser.
- The process repeats in a continual "Post Back" cycle.
Definition of HTTP Modules
HTTP modules are a logical replacement for ISAPI filters. Modules are
a class that can participate in every web request. This is appropriate
for code that should run on every request, such as caching, authentication
or state management.
Definition
of HTTP Handlers
HTTP Handlers provide the end point in the processing of a web request
and are equivalent to ISAPI Extensions today. For example, many handlers
can be involved in the request for an ASPX page, but only 1 handler
is invoked. The handler runs after the HTTP modules have run. Which
handler is invoked is determined by configuration settings in the config.web
file. Handlers are assigned to handle requests based on the extension
of the page requested.
|