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

How To Generate ConnectionString By Using Notepad??

2 Answers  


can u create two Primary key for a table? --Sivaa

10 Answers   BirlaSoft,


What are two ways that you can set the minimum and maximum values for a rangevalidator? When would you use each technique?

1 Answers  


Dataset is the disconnected environment. suppose if you are binding records to gridview (disconnected environment) and you are making changes to the the grid but before updating the database if any other user modify the data, how will you avoid such problem?

0 Answers   Hexaware, Infosys,


What is the use of placeholder control?

0 Answers  






What are the Types of session management in ASP.NET

0 Answers   Microsoft,


Explain exception filters?

0 Answers  


What is microsoft windows sharepoint services?

0 Answers  


WHAT IS OBJECT POOLING

2 Answers   Fidelity,


How would you get ASP.NET running in Apache web servers - why would you even do this?

1 Answers   Siebel Systems,


I have an external link in my application say www.xyztest.com. Today this site works on http protocal. Tommorow it may run on https. So i cant hardcore the protocal in the site. When a user clicks on the link how can i know if the external site works on http or https and takes him to that place?

0 Answers   TCS,


Have you used microsoft dataaccess blocks and Exception blocks?

1 Answers   Microsoft,


Categories