<%@ WebHandler language= "C #" class= "Changepwd"%> using System; using system.web; Using System.Web.SessionState; public class Changepwd:ihttphandler, ireadonlysessionstate {public void ProcessRequest (HttpContext context) { Context. Response.ContentType = "Text/plain"; Operuser ou = new Operuser (); if (OU. Changewspassword (context. session["Ws_user"]. ToString (), context. request.querystring["PWD"]. ToString ())) {context. Response.Write ("true"); } else {context. Response.Write ("Flase"); }} public bool IsReusable {get {return false; } } }
Plus using System.Web.SessionState; ireadonlysessionstate
If your handler accesses session-state values, it must implement IRequiresSessionState Interface (a markup interface that does not contain any methods).
Import using System.Web.SessionState;
Sure enough, as long as you add a irequiressessionstate tag interface to your custom class, you don't need to implement any methods.
With this, there is another interface: The Ireadonlysessionstate interface, which indicates an HTTP handler, a read-only permission to the session, and an empty interface, without implementing any method.