|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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... |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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();"> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > IE6 - Double Posting Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|