context.Session is null

G

Guest

Hi;

I have a page that is created from a class using:
<httpHandlers>
<add verb="*" path="report-create.aspx" type="ReportCreate"/>
</httpHandlers>

and the code is:
public class ReportCreate : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
....

The problem is that context.Session is null as is
HttpContext.Current.Session - how do I get the session object?
 
Joined
Sep 20, 2008
Messages
11
Reaction score
0
So what did you really do?

The code at the link says you test the state of Context.Handler:

Code:
        bool requiresSession = false;

        if (Context.Handler is IRequiresSessionState)
            requiresSession = true;

So how do you get Context.Handler not to be null/to require Session State? I have this issue where my extra .cs files can't get the values of the Session variables I created and stored values to in Default.aspx.cs just fine.

-Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top