Friday, 13 September 2013

How to use Session State/Session Object in HTTPHandler

Have your HttpHandler inherit from IRequiresSessionState. It will enable session state use. IRequiresSessionState can be found in the System.Web.SessionState namespace.

Example:

using System.Web.SessionState;

public class SMSHandler : IHttpHandler,IRequiresSessionState

 {
       
         public void ProcessRequest(HttpContext context)
        {
          
              //Your code goes here..
         }
  }

Source: how-to-use-asp-net-session-state-in-an-httphandler

No comments:

Post a Comment

How to Send Email from Python

Please find the below sample code to send email from Python. import os import smtplib from email.mime.multipart import MIMEMultipart...