ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 13th, 2003, 06:19 PM
LanceH LanceH is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 2 LanceH User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
IE6 - Double Posting Problem

I am experiencing the following problem with a web site I have developed:

IE6 users submit a request to an ASP page which (among other things) sends an e-mail, however, the page appears to be submitted twice since two e-mails are sent.

I have verified that the page is being submitted twice (by IE6 somehow and not through user action) by attaching a time to the content of the sent e-mail. With a single submit at the client end, the server process the page twice and two messages (with slightly different times) are sent.

It would seem that the initial submit initiates the ASP page on the server, then there is a reset at the server end and the submit is reprocessed before the HTML is returned to the client.

The same operation from IE5 (or IE5.5) functions as expected; that is, only one message is sent.

I have previously found a thread which relates to this problem on Dev Shed, but I cannot find any solutions - even after many hours of searching MSDN KB, etc. The previous thread dates from March this year and exactly describes the problem I am having - even in so far as that the problem seems to have started suddenly and for no apparent reason.

Please help...

Reply With Quote
  #2  
Old October 15th, 2003, 01:04 AM
LanceH LanceH is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 2 LanceH User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thought I'd reply to myself here (since there were no other takers) and also for the sake of completeness as I have found a solution (of sorts):

I ended up creating an ASP Session variable on the web page leading into the page where the double-post was occuring and initially setting this variable to have a value of False. Then in the page where the problem actually occurs (ie. the e-mail is sent twice), I check to see if the Session variable is False, if so Send the e-mail and toggle the value of the Session variable to True.

This works in that the e-mail is now only sent once - the odd thing is

As an aside - I have found that this problem only occurs with some IE6 "versions" (and there are many given all the Microsoft hotfixes/service packs etc. that apply).

I hope this is of some use to somebody out there - your mileage may vary but I know that this was driving me nuts for quite a while.

Some code follows:

In Page 1 (leaving this page invokes Page 2 where the problem occurs):

Code:
...
Session("EmailSent") = False
...


In Page 2:

Code:
If Session("EmailSent") = False Then
	'This is a workaround for some IE6 clients that cause "double-posting" of requests'
	intReturn= objMail.Send()
	Session("EmailSent") = True
End If


"That's it folks (and thanks for all your responses)", he said with tongue firmly in cheek.

Last edited by LanceH : October 15th, 2003 at 09:39 PM.

Reply With Quote
  #3  
Old October 30th, 2003, 06:33 AM
kestralFlight kestralFlight is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 kestralFlight User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
mabye this

here is what it might be

<input class="input" type="submit " name="Submit" value="Submit" onClick="javascript:submitit();">

if you use javascript to submit the form

do not use a button type of submit.........it will submit twice

correct code

<input class="input" type="button " name="Submit" value="Submit" onClick="javascript:submitit();">

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > IE6 - Double Posting Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT