473,507 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Httphandler and session problem with html pages

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
Nov 18 '05 #1
4 4226
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
"Igor K" <ig**@exor.hr> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2
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.

--
Matt Berther
http://www.mattberther.com
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


Nov 18 '05 #3
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
"Matt Berther" <mb******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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.

--
Matt Berther
http://www.mattberther.com
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

Nov 18 '05 #4
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...

--
Matt Berther
http://www.mattberther.com
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

"Matt Berther" <mb******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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.

--
Matt Berther
http://www.mattberther.com
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


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2529
by: Igor K | last post by:
Hi, I'm intercepting http requests coming to my asp.net application in order to do some additional processing of html pages. I'm having problems to access my variables stored in Session Object,...
4
5019
by: Jeremy Lew | last post by:
When my HttpHandler is processing a request when installed on a particular 2003 Server machine, the Context.Session object is null. Any idea why this might be? My handler implements...
2
2131
by: rpale | last post by:
We want to create server-side code that will retrieve the user requested pages, then manipulate the content of those pages just before being sent back to the user. We tried the following: ...
8
3870
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
5
1591
by: the4man | last post by:
Hi all! I have an app that show images that are stored in SQL Server. To show the images on screen, until now (with the "old" ASP), I use the following code: <img src="showimage.asp?id=20"...
7
2670
by: Ty | last post by:
Hi, All- I have a custom httphandler that outputs an image to the browser based upon some user input. I'd like to be able to store information about that image in session and have them...
0
1217
by: uraanu | last post by:
I am having an issue with sessions and httphandlers. I have some tracking information that I am passing in my url as folders (ie: www.mysite.com/info1/44/info2/55/mypage.aspx) which I am capturing...
2
2460
by: Roshawn | last post by:
Hi, I've been fighting tooth and nail trying to handle clunky viewstate data. I happened to find some code that moves this data to the bottom of the page (to enhance spidering, of course). ...
5
4307
by: zlf | last post by:
Hello, I try to use a custom HttpHandler to add something to session, then display the original page. public void ProcessRequest(HttpContext context) { context.Session = "test"; } But, a...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.