ASP.NET 핸들러 사용시, Session 처리

2.0 기준으로 Ashx를 사용시에

context.Session의 값을 처리할 때 null로 표시되는데,

클래스 선언시에 System.Web.SessionState.IReadOnlySessionState 도 상속 받으면 문제없이 사용가능

public class Handler : IHttpHandler, System.Web.SessionState.IReadOnlySessionState {

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

와 같다.

Tags:

Leave a Comment