What is HTTPContext and HTTPModule. What is the use of them?



What is HTTPContext and HTTPModule. What is the use of them?..

Answer / 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

More ASP.NET Interview Questions

Explain culture and uiculture values.

0 Answers  


What is asp short for?

0 Answers  


How do you perform validations ?

2 Answers   Microsoft,


What are different ASP.NET Web Forms with the technology different from though ASP (1.0-3.0)?

1 Answers   Siebel,


Fetch one page value to another page without using state-managment ?

0 Answers   HCL,






What is the difference between mvc and asp.net? : Asp.Net MVC

0 Answers  


Could u send me the answer for this question as soon as possible. Im using 'System.net.mail.mailmessage' namespace for sending a mail from my application. What should I mention in 'system.net.mail.mailmessage.to' property and What should I mention in 'system.net.mail.mailmessage.from' property.

1 Answers  


what if we delete web.config or machine.config? will a website work if we delete webconfig....or if we delete machine config?

4 Answers   TCS,


What are the page life cycle events?

0 Answers  


Explain about Application and Session Events ?

0 Answers  


How do you add a javascript function for a link button in a datagrid ?

4 Answers   Microsoft,


What is a gridview in asp.net?

0 Answers  


Categories