4

What is the advantage of intercepting a request for an ASP.Net application at the HttpContext level rather than waiting for the request to be processed by the HttpApplication pipeline?

Chris
  • 6,272
  • 9
  • 35
  • 57

2 Answers2

3

You're comparing apples to oranges. The HTTPContext holds the HTTP-specific information about an individual HTTP request while an HTTPApplication contains events that process that request.

Perhaps you are referring to HTTPHandlers and HTTPModules? In other words you would intercept a request using an HTTPHandler referencing the HTTPContext to get information about that request like the query string etc...

Ian Ringrose
  • 51,220
  • 55
  • 213
  • 317
Bob Jacobs
  • 120
  • 1
  • 6
  • Ah ha! When you said "you would intercept a request using an HTTPHandler referencing the HTTPContext to get information about that request like the query string etc" actually jived with what another developer and I have had a conversation about. While the code we're looking at isn't an advantage over HttpApplication, it's accessing a totally different area with different information. Thanks for the second opinion on this! – Chris Sep 09 '10 at 23:00
2

This may help you in understanding the concepts

HttpContext Class

HttpApplication Class

Thanks