Search code examples
asp.netenterprise-web-library

How do I store per-request state in EWL?


I want to store some state whose lifetime is the request. I believe I used to be able to store state manually in AppRequestState, but that class no longer provides that capability.

As a fallback I am going to store the state in Session, but I'd prefer its lifetime were just the request, not the session. What is the most supported way to do this in EWL?


Solution

  • EWL deliberately doesn't let you store your own per-request state since it's really easy to get into trouble by doing this. See "Letting pages store request-scoped data" here:

    https://enduracode.fogbugz.com/default.asp?W6