asp.net HttpHandler operates on the Session function code

  • 2020-05-16 06:41:41
  • OfStack

 
using System; 
using System.Web; 
using System.Web.SessionState; 

public class HandleDataRequst : IHttpHandler, IRequiresSessionState 
{ 

public void ProcessRequest (HttpContext context) { 
//context.Session["name"] 
} 

The point here is that 1 must implement IRequiresSessionState or IReadOnlySessionState, otherwise Session is always null

Of course, no methods are specified in either interface.

Related articles: