Httphandler and session problem with html pages

I

Igor K

Hi all,

I'm developing asp.net website. Most of the pages are aspx, but let's say,
some 10% are html. For this html pages i use httphandlers to intercept calls
and to perform some job on this pages.

Lately I need to access Session state in HttpHandler's code. This seems to
be the problem. I searched the internet for some solution, i always found
advice to dervie from IHttpHandler and that will do, but obivously not.

So I tried to solve it using Global.asax (to intercept the call also there
where I was expecting to find session state). Events are not even triggered
for my html pages when httphanlder is used. If I disable httphandler
temporary, events arrive, but no session object.

I tried HttpModules, the same problem arrises - no session for html page.


For aspx pages everything and everywhere works fine.



Any advice?


I forgot to mention that I'd like to use sessions in order to track my web
site user navigation (to build history list + abitlity to move back and
forward using custom back/forward buttons)


Thanks, any help is appreciated,

Igor
 
J

John Timney \(Microsoft MVP\)

I assume you have mapped the .htm extension in IIS to be handled by the same
ISAPI that processes aspx

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
M

Matt Berther

Hello Igor,

Have you also marked your HttpHandler with one of these two interfaces?

IRequireSessionState or IReadOnlySessionState

These will give you session state in an HttpHandler.
 
I

Igor K

Thanks, but of I did it exactly this way.

I'm doing this on ProcessRequest handler, trying to reference
HttpContext.Current.Session. The problem is that I always have IsNewSession
= true,
any other ideas?

Igor
 
M

Matt Berther

Hello Igor,

While they should be the same, why not use the HttpContext that was passed to ProcessRequest? I've posted a sample in your next post...
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top