Skip to content

Instantly share code, notes, and snippets.

@fengelz
Created September 26, 2011 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fengelz/1242048 to your computer and use it in GitHub Desktop.
Save fengelz/1242048 to your computer and use it in GitHub Desktop.
Maintain sessionstate in generic ashx handler
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MyGenericHandler
{
/// <summary>
/// Summary description for $codebehindclassname$
/// </summary>
public class Handler : IHttpHandler,
System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
context.Session.Add("myVal",
context.Request["myVal"]);
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment