Results 1 to 5 of 5

Thread: form can be submitted twice

  1. #1

    Thread Starter
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158

    form can be submitted twice

    I'm getting this strange problem whereby it seems that the same webform can get submitted twice even though I use response.redirect in my button click event. Some of the code in the button click event is executing (ie the update of the database and the sending of an email), but the page does not redirect). It doesn't happen on my development machine, and I think it could be something to do with the loggedin user's connection speed, but whatever it is, its a major pain, as they are able to click the button again, and create duplicate DB records and emails. I can kind of re-create this by submitting the page, and then quickly hitting the browser's stop button before the page redirects (the DB gets updated, the email gets sent, but the page does not redirect(allowin me to click the button a second time). Any ideas? Thanks in advance!

    Pete

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I thought you were on vacation?!

  3. #3
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    ASP.NET (or was it iis) by default waits for the entire response stream to be written before it sends it to the client.

    The best you can do is :
    1) disable the submit button when clicked using javascript... and then post the page.

    2) Check if the user has submitted something within 5 seconds of one another (by using a time stamp), and ignore the second post.

  4. #4

    Thread Starter
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    Originally posted by mendhak
    I thought you were on vacation?!
    got a job in Sydney! Can't be a travelling dosser for ever! Might just stay here for a while, I like it a lot!

  5. #5

    Thread Starter
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    Originally posted by nemaroller
    ASP.NET (or was it iis) by default waits for the entire response stream to be written before it sends it to the client.

    The best you can do is :
    1) disable the submit button when clicked using javascript... and then post the page.

    2) Check if the user has submitted something within 5 seconds of one another (by using a time stamp), and ignore the second post.
    thanks nemaroller, I'll try something like that!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width