Im sure there was a request-wide object
-based storage medium, similar to HttpContext.Current.Session
, that persisted globally just for the life of a single request, but I cannot for the life of me remember it.
I bet you're thinking of HttpContext.Items.
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.
Very useful for sharing state between HttpModules, HttpHandlers and pages from different parts of the request cycle.
More reading:
Note that HttpContext.Items works for both ASP.NET WebForms and ASP.NET MVC but it there's a caveat when using both in the same web app. More about that in this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With