Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Stopping Repeated Form Submission

Reply
Thread Tools

Stopping Repeated Form Submission

 
 
KV
Guest
Posts: n/a
 
      04-28-2004
I need to stop the user from getting the following message:

"The page cannot be refreshed without resending the information.
Click Retry to send the information again,
or click Cancel to return to the page that you were trying to view."

OR, I need to stop the form button from being activated again and again.

In my situation, I have a form with labels, text boxes, and a datagrid.
Every time I add something to the text boxes and click on the button, the
database is updated and the datagrid is refreshed. If the form is refreshed
and I click on "retry", then the database gets updated again with the same
information from the text boxes (as if I clicked the button). This is
undesirable, since I'm getting many duplicate records.

I added a "if not ispostback" statement and it takes care of the problem.
But now my datagrid doesn't display right, because I need those records
added to the database once whenever the form is submitted. So now I'm
caught in between a rock and a hard place. If I keep the logic in I get
dups, if I limit it then the datagrid never gets updated until the page is
manually refreshed.

Any ideas?

-Kevin


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      04-28-2004
you should add a transaction guid to every page, and log if its been
processed, this way you can ignore double postbacks, but the user can
resubmit if the transaction failed (deadlock), or was lost in the internet,
or IE failed to post correctly.

-- bruce (sqlwork.com)


"KV" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I need to stop the user from getting the following message:
>
> "The page cannot be refreshed without resending the information.
> Click Retry to send the information again,
> or click Cancel to return to the page that you were trying to view."
>
> OR, I need to stop the form button from being activated again and again.
>
> In my situation, I have a form with labels, text boxes, and a datagrid.
> Every time I add something to the text boxes and click on the button, the
> database is updated and the datagrid is refreshed. If the form is

refreshed
> and I click on "retry", then the database gets updated again with the same
> information from the text boxes (as if I clicked the button). This is
> undesirable, since I'm getting many duplicate records.
>
> I added a "if not ispostback" statement and it takes care of the problem.
> But now my datagrid doesn't display right, because I need those records
> added to the database once whenever the form is submitted. So now I'm
> caught in between a rock and a hard place. If I keep the logic in I get
> dups, if I limit it then the datagrid never gets updated until the page is
> manually refreshed.
>
> Any ideas?
>
> -Kevin
>
>



 
Reply With Quote
 
 
 
 
KV
Guest
Posts: n/a
 
      04-28-2004
Thanks for the pointer. I did a search for "transaction guide" (looking for
code samples) but didn't come up with anything. What's the easiest way to
implement a transaction guide?

-Kevin


 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Stopping Repeated Form Submission KV ASP .Net 2 04-30-2004 02:10 PM
duplicate form submission Boban Dragojlovic ASP .Net 2 02-03-2004 03:40 PM
Re: Offline Form Submission Tim Stephenson ASP .Net 0 10-15-2003 10:06 AM
(onetime) Form Submission Leon Shaw ASP .Net 1 08-15-2003 03:15 AM
Form Submission: Final URL that has form options included ?? Jared Javascript 5 07-10-2003 10:33 AM



Advertisments