简体   繁体   English

如何在EWL中存储每个请求状态?

[英]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. 我相信我曾经能够在AppRequestState中手动存储状态,但是该类不再提供该功能。

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. 作为后备,我将状态存储在Session中,但我希望状态的生存期仅是请求,而不是会话。 What is the most supported way to do this in EWL? 在EWL中,最受支持的方法是什么?

EWL deliberately doesn't let you store your own per-request state since it's really easy to get into trouble by doing this. EWL故意不允许您存储自己的每个请求状态,因为这样做很容易惹麻烦。 See "Letting pages store request-scoped data" here: 请参阅此处的“退出页面存储请求范围的数据”:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 ASP.Net MVC 中禁用 Session state 每个请求 - Disable Session state per-request in ASP.Net MVC 如何在 ASP.NET 中限制每个请求 memory 的使用? - How to limit per-request memory usage in ASP.NET? 在 ASP.Net Web Api (ApiController) 中禁用每个请求的会话状态 - Disable Session state per-request in ASP.Net Web Api (ApiController) ASP.NET和ActiveDirectory是否存在按请求(自定义)角色? - Do Per-Request (Custom) Roles exist for ASP.NET and ActiveDirectory? Unity DI:从每个请求到全局单例再到每个请求 - Unity DI: Resolving from per-request to global singleton to per-request 无需使用HttpModule即可处理声明式按请求数据 - Disposing declarative per-request data without using an HttpModule 我需要做什么才能使EWL快捷方式URL起作用? - What do I have to do to get EWL Shortcut URLs to work? 使用nancy模块属性作为“按请求”存储是否安全? - Safe to use a nancy module property as 'per-request' storage? 使用HttpRequestMessage.Properties承载每个请求上下文 - Carrying per-request context using the HttpRequestMessage.Properties ASP.NET中的Per-Request静态数据 - Per-Request static data in ASP.NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM