How can I use Session variable in an HttpHandler

前端 未结 2 802
遇见更好的自我
遇见更好的自我 2020-12-18 03:09

Goal: I have a thumbnail as a byte array in memory. Once a user uploads their image, I want to display it in an httphandler before writing it to the database. I have used th

2条回答
  •  温柔的废话
    2020-12-18 03:39

    Thorarin was correct. I had to implement IRequiresSessionState. What I didn't realize was that I then had to refer to the variable as

    context.Session("oUser")
    

    instead of

    Session("oUser")
    

提交回复
热议问题