zoukankan      html  css  js  c++  java
  • HttpHandler使用Session

    继承自IHttpHandler的类要实现两个接口:ProcessRequestIsReusable
    但还不能使用Session,要使用Session需要下面的步骤处理:
     
    1、先引用System.Web.SessionState 这个命名空间, 
    2、如果是要在HttpHandler 中读取Session的内容,就要在实现IHttpHandler 的类中同时实现IReadOnlySessionState 这个接口。
    3、如果是要在HttpHandler 中读写Session的内容,就要在实现IHttpHandler 的类中同时实现IRequiresSessionState

    例:
    public class ProductPayEntry : IHttpHandler, IReadOnlySessionState 
    public class ProductPayEntry : IHttpHandler, IRequiresSessionState

  • 相关阅读:
    python笔记目录
    Django 的View(视图)系统
    051_Bootstrap 框架
    050_jQuery 事件
    049_jQuery 操作标签
    048_jQuery
    016-递归函数
    047_BOM_DOM
    046_JS
    045_CSS
  • 原文地址:https://www.cnblogs.com/WarBlog/p/5821984.html
Copyright © 2011-2022 走看看