473,498 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IHttpHandler, ProcessRequest and Session

I've got the IRequiresSessionState interface implemented, but because of
forms authentication my page fires twice and causes certain session
functions to update twice which messes up my values.

Is there anyway to keep ProcessRequest from firing twice, or detect if it
has fired once and not call certain functions in the page again on the
second time through?
Nov 19 '05 #1
4 2197
Hi,
because of forms authentication my page fires twice


What do you mean with this? Can you elaborate a bit? Do you have some custom
authentication in use with Forms authentication (or just that page gts
executed twice for a good reason?).

--
Teemu Keiski
ASP.NET MVP, Finland

Nov 19 '05 #2

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:ud**************@TK2MSFTNGP14.phx.gbl...
Hi,
because of forms authentication my page fires twice
What do you mean with this? Can you elaborate a bit? Do you have some
custom authentication in use with Forms authentication (or just that page
gts executed twice for a good reason?).


I was refering to this thread:

http://tinyurl.com/66lm8

I'm experiencing the same thing. I make a handler and create a page that is
made in csharp.
All events in the page class fire twice, and I'm assuming that is due to the
comment in the link above.
Everything else works fine, that page displays, events that I wire up in
controls fire and all is great.

Except session variables end up getting set twice. So:

Session("item1") = Session("item1") + somevalue

ends up happending twice and I get

Session("item1") = Session("item1") + somevalue + somevalue

I wondering if anyone else might have a convenient "global" work around for
this. I've run into a wall, as I've been working on it for three days now.

--
Teemu Keiski
ASP.NET MVP, Finland

Nov 19 '05 #3
Hmm...can you try getting past it with checking Request.IsAuthenticated (or
does it return Ture in your case for the very first request)?

--
Teemu Keiski
ASP.NET MVP, Finland
"Chance Hopkins" <ch************@hotmail.com> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:ud**************@TK2MSFTNGP14.phx.gbl...
Hi,
because of forms authentication my page fires twice


What do you mean with this? Can you elaborate a bit? Do you have some
custom authentication in use with Forms authentication (or just that page
gts executed twice for a good reason?).


I was refering to this thread:

http://tinyurl.com/66lm8

I'm experiencing the same thing. I make a handler and create a page that
is made in csharp.
All events in the page class fire twice, and I'm assuming that is due to
the comment in the link above.
Everything else works fine, that page displays, events that I wire up in
controls fire and all is great.

Except session variables end up getting set twice. So:

Session("item1") = Session("item1") + somevalue

ends up happending twice and I get

Session("item1") = Session("item1") + somevalue + somevalue

I wondering if anyone else might have a convenient "global" work around
for this. I've run into a wall, as I've been working on it for three days
now.

--
Teemu Keiski
ASP.NET MVP, Finland


Nov 19 '05 #4

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hmm...can you try getting past it with checking Request.IsAuthenticated
(or does it return Ture in your case for the very first request)?
Good thinking, but it looks like it returns true both times.

I also just tried setting this in web.config

<pages autoEventWireup="false" />

as discribed in this article:

http://support.microsoft.com/default...b;EN-US;317690

I heard that fired events twice sometimes, although I'm working in csharp.

I may end up having to figure out a different way to pass this value around.
It would be nice to be able to figure out a work around though, for the
future.

--
Teemu Keiski
ASP.NET MVP, Finland
"Chance Hopkins" <ch************@hotmail.com> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:ud**************@TK2MSFTNGP14.phx.gbl...
Hi,

because of forms authentication my page fires twice

What do you mean with this? Can you elaborate a bit? Do you have some
custom authentication in use with Forms authentication (or just that
page gts executed twice for a good reason?).


I was refering to this thread:

http://tinyurl.com/66lm8

I'm experiencing the same thing. I make a handler and create a page that
is made in csharp.
All events in the page class fire twice, and I'm assuming that is due to
the comment in the link above.
Everything else works fine, that page displays, events that I wire up in
controls fire and all is great.

Except session variables end up getting set twice. So:

Session("item1") = Session("item1") + somevalue

ends up happending twice and I get

Session("item1") = Session("item1") + somevalue + somevalue

I wondering if anyone else might have a convenient "global" work around
for this. I've run into a wall, as I've been working on it for three days
now.

--
Teemu Keiski
ASP.NET MVP, Finland



Nov 19 '05 #5

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

Similar topics

0
1446
by: lapin | last post by:
I'm trying to get access to session variables from an IHttpHandler class. In several places I've seen the solution posted as in this message: >If you define your own custom HttpHandler, you need...
1
3061
by: lapin | last post by:
I'm trying to get access to session variables from an IHttpHandler class. In several places I've seen the solution posted as in this message: >If you define your own custom HttpHandler, you...
13
4281
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
5
1992
by: vimakefile | last post by:
I'd like to have the concept of a Page (different code-behind file for each url, session state, etc.) but be able to specify my own custom HTTP payload. (I don't want to use any Asp.Net forms,...
2
8025
by: bryan | last post by:
I can't find much info on what makes an instance of the handler reusable. If it maintains no internal state, I would assume that it is safe to be reusable - correct? I have one that grabs a value...
1
1271
by: David Thielen | last post by:
Hi; I just wrote my first IHttpHandler and am having a problem. If the content type is "text/html" then the below code works fine. But if it's "text/plain" then my browser gets: The XML page...
1
1849
by: X | last post by:
I am trying to invoke a javascript function from IHttpHandler using Context.Response.Write. The function is present in .js file and is not being invoked. The following snippet is called from...
1
4293
by: Aartware | last post by:
I've read all the items about the IHttpHandler and the session-object and I see nothing wrong with my code, but still I have no session object. This is my code: Imports System Imports...
0
1186
by: shapper | last post by:
Hello, I am using an ASP.NET 3.5 SP1 and a while ago I created an IHttpHandler that transforms a Sitemap XML file to a compatible Google Sitemap (https://www.google.com/webmasters/tools/docs/en/...
0
7124
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
6998
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...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
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.