Saturday, April 19, 2014

Access Session Variable in ASHX Files ASP.NET

Many of us has found an obstacle to access the session variables in our generic handler. Here i found the right way to access the session variables in our handler file (.ashx).

For that you need to import an extra namespace,

using System.Web.SessionState;

Then inherit the class with an extra interface named  IReadOnlySessionState.


Now using the context variable you can access the session variable. So simple and so easy.

Reference : hanselman.com

0 comments:

Post a Comment

Follow by Email

Popular Posts

Pageviews