【问题标题】:Caching object in Application_AuthenticateRequest在 Application_AuthenticateRequest 中缓存对象
【发布时间】:2010-11-23 06:06:40
【问题描述】:

Application_AuthenticateRequest 中是否有任何用户特定的缓存对象可用?我注意到 Session 和 Cache 不可用。我正在使用 .net 框架 3.5 和 aspx。

【问题讨论】:

    标签: asp.net .net-3.5


    【解决方案1】:

    您应该能够通过以下方式访问您想要的内容:

    HttpContext.Current
    

    【讨论】:

    • HttpContext.Current.Session 在 Application_AuthenticateRequest 期间未设置。 HttpRuntime.Cache 是应用程序范围的,而不是特定于用户的。有谁知道任何替代方案?
    猜你喜欢
    • 2020-07-11
    • 2012-09-15
    • 1970-01-01
    • 2011-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-02
    • 2017-11-16
    相关资源
    最近更新 更多