| |
|
What is an HTTP handler in ASP.NET? Can we use it to upload files? What is HttpModule?
An advanced programmer needs to be well prepared with this question in any
interview. The HttpHandler and HttpModule are used by ASP.NET to handle requests.
Whenever the IIS Server recieves a request, it looks for an ISAPI filter that is capable
of handling web requests. In ASP.NET, this is done by aspnet_isapi.dll. Same kind
of process happens when an ASP.NET page is trigerred. It looks for HttpHandler in the web.config
files for any request setting. As in machine.config default setting, the .aspx files are
mapped to PageHandlerFactory, and the .asmx files are mapped to the WebServiceHandlerFactory.
There are many requests processed by ASP.NET in this cycle, like
BeginRequest,
AuthenticateRequest,
AuthorizeRequest,
AcquireRequestState,
ResolveRequestCache,
Page Constructor,
PreRequestHandlerExecute,
Page.Init,
Page.Load,
PostRequestHandlerExecute,
ReleaseRequestState,
UpdateRequestCache,
EndRequest,
PreSendRequestHeaders,
PreSendRequestContent.
Yes, the HttpHandler may be used to upload files.
HttpModules are components of .NET that implement the System.Web.IHttpModule interface.
These components register for some events and are then invoked during the request processing. It
implements the Init and the Dispose methods. HttpModules has events like
AcquireRequestState, AuthenticateRequest, AuthorizeRequest, BeginRequest, Disposed
, EndRequest, Error, PostRequestHandlerExecute, PreRequestHandlerExecute, PreSendRequestHeaders,
ReleaseRequestState, ResolveRequestCache, UpdateRequestCache
Page Redirection
Values Between Pages
Worker Process
Page Life Cycle
Global Variables
Postback
Server Control
Viewstate
Send Email
Namespace
Localization
Event Handler
Validation
Global.asax
HttpHandler
Session
Cookie
EnableViewState
Smart Navigation
Web Farm
Dataset
Register
| |