【问题标题】:Determine if session has timed out when making an ajax call to httphandler确定对 httphandler 进行 ajax 调用时会话是否超时
【发布时间】:2013-05-28 11:22:55
【问题描述】:

我正在对 httphandler (.ashx) 进行 jQuery ajax 调用。在发出 ajax 请求之前,有什么方法可以知道会话是否已超时?

如果发生超时,我将获得 web.config 中指定的登录页面作为对 ajax 调用的响应,而不是我的常规 JSON。

一个快速而丑陋的解决方案是假设每次我在error 回调中结束,这是因为当数据类型设置为 JSON 时我得到 HTML 作为响应。但是我想有更好的方法来解决这个问题吗?

【问题讨论】:

    标签: jquery asp.net ajax


    【解决方案1】:

    你必须尝试IReadOnlySessionState接口。

    Check

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-02
      相关资源
      最近更新 更多