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 authenticate users using web.config ?

1 Answers   Patni,


What is virtual directory in asp.net?

0 Answers  


How to publish website

1 Answers   Syntel,


What is a response cookie?

0 Answers  


we are working in .net namespaces like using system.io,system.text. these namespace before we use "using " keyword what means of using?

7 Answers   CEI, CSC, HCL, Tech Mahindra,


Please brief not about xsd,xslt & xml?

0 Answers  


How could you modify xaml content from javascript?

0 Answers  


What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?

4 Answers  


What is Web Services?How we can consume a Web Services in our application?Explain.

1 Answers   Religare,


Explain the difference between page.registerclientscriptblock and page.registerstartupscript?

0 Answers  


Whats the difference between abstract factory pattern and factory pattern?

0 Answers  


What are the advantages of using sql stored procedures instead of adhoc sql queries in an asp.net web application?

0 Answers  


Categories