views:

78

answers:

1

From an HTTP module, is there a way to persist something in the Request to be accessed by a mater module or the eventual handler? Can you "stick" something on the Request as it passes through that will still be there later in the pipeline?

+2  A: 

You can use the HttpContext (the one exposed by the static Current property). It has an Items property which is meant to be used specifically to shuttle data between modules and handlers, as indicated by the documentation:

Gets a key/value collection that can be used to organize and share data between an IHttpModule interface and an IHttpHandler interface during an HTTP request.

Which can be located here:

http://msdn.microsoft.com/en-us/library/system.web.httpcontext.items.aspx

casperOne
Excellent. Thank you.
Deane