Asp.Net Session is null in ashx file

后端 未结 2 1217
挽巷
挽巷 2020-12-01 01:54

I am trying to access the Session variable in Asp.Net ashx handler as shown below.

public void ProcessRequest (HttpContext context) {
              


        
2条回答
  •  醉酒成梦
    2020-12-01 02:36

    You have to "implement" either IRequiresSessionState or IReadOnlySessionState, with former providing full access to session, and the latter providing read-only access.

    I'm quoting "implement" here because these two are so-called "marker interfaces", which means they have no members.

提交回复
热议问题