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
How do I use response redirect?
What is AutoEventWireup attribute for ?
Can you edit data in the Repeater control? Which template must you provide, in order to display data in a Repeater control? How can you provide an alternating color scheme in a Repeater control? What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
Which methods validate all the controls on a page?
What is cookies cache and session?
To display data in a Repeater control which template you provide?
List some of the important session state modes of asp.net.
Why is asp.net so popular?
Describe how ASP.NET maintains process isolation for each Web application?
What is & in a url?
Who is using asp.net?
Explain the server control events of asp.net ?
What is the difference between session.abandon() vs clear()?
Can you explain one critical mapping? Performance issue which one is better?
What is the asp.net mvc folder conventions? : asp.net mvc