What is HTTPContext and HTTPModule. What is the use of them?
Answer Posted / kk
HttpModule handles a application related events and
httpmodule serve the same purpose as does by ISAPi filter
for primitive ASP.Httpmodule by default have following
feature to support
Output Caching
Session State
Windows Authentication
Forms Authentication
Passport Authentication
Role Manager
URL Authorization
File Authorization
Anonymous Identification
Profile
One can make custome httpmodule and can place in web.config
so that at runtime it can process the chain of request as
and when comes .This can be identify through extension based
processing files.For an e.g there is custom class which when
invoke render charts as per the data input.This basically
can be wrapped in httpModule for processing and rendering
the class object at runtime.
HttpContext: This belongs to System.Web,this actually the
best way to read server response at runtime.
1)For example there is property and one want to get and set
the value of property that can easily be achieved through
httpcontext.
((CustomerClass)HttpContext.Current.Item).CustomerIDProperty=78;
2)similarly one can store the current context in collection
format.
HttpContext.Current.Items.Add("ERROR_MSG", exception.Message);
3) Can do server.transfer
HttpContext.Current.Server.Transfer("~/CriticalException.aspx",
false);
www.brainbell.com/tutorials/ASP/HttpModules.html
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is css and what is it used for?
Explain how viewstate is being formed?
What is the difference between cookie and session?
Can you set which type of comparison you want to perform by the comparevalidator control?
Why Unload event of MasterPage Calls first in ASP.net ?
How can we create Tree control in asp.net?
What is application in asp net?
Should I delete cookies?
What is anonymous authentication?
What is the difference between viewstate and hidden field in asp.net?
How does exception management works in ASP.NET?
How asp.net mvc differs from asp.net web forms? : asp.net mvc
How can you debug your.net application?
Is asp.net and .net the same?
What is the use of autowireup in asp.net?