473,499 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Preventing multiple form submissions (multiple postbacks)

Hi-

I am developing an ASP.NET application that can take a few seconds to
process the request from the user. We are looking for a client-side
solution that will prevent users from resubmitting the page multiple
time in their irrational impatience.

There are a few posts on this group which suggest that we use
JavaScript hooked up to the page's OnSubmit event to catch mulitple
submissions. See postings by Craig Deelsnyder et alia.

But, and here is the catch... The OnSumbit event only gets called if
the user clicks a Submit button. And unfortunately we have an
application with dozens of pages, but nary a single Submit button. We
use linkbuttons hooked up to events pretty much everywhere to do our
saving (which seems to be standard practice) and linkbuttons do not
trigger OnSubmit.

Any suggestions on how to popup a "We are working on your request,
please stop clicking" dialog?

Diane "America's Developer" Selby
Nov 18 '05 #1
4 5011
onclick ?
"Diane Selby" <so*************@yahoo.com> wrote in message
news:29**************************@posting.google.c om...
Hi-

I am developing an ASP.NET application that can take a few seconds to
process the request from the user. We are looking for a client-side
solution that will prevent users from resubmitting the page multiple
time in their irrational impatience.

There are a few posts on this group which suggest that we use
JavaScript hooked up to the page's OnSubmit event to catch mulitple
submissions. See postings by Craig Deelsnyder et alia.

But, and here is the catch... The OnSumbit event only gets called if
the user clicks a Submit button. And unfortunately we have an
application with dozens of pages, but nary a single Submit button. We
use linkbuttons hooked up to events pretty much everywhere to do our
saving (which seems to be standard practice) and linkbuttons do not
trigger OnSubmit.

Any suggestions on how to popup a "We are working on your request,
please stop clicking" dialog?

Diane "America's Developer" Selby

Nov 18 '05 #2
What you need to do is redirect to another page when the user clicks the
button. This way the client immediately sees a "please wait" page.

Place this when the button is clicked:

Response.Redirect("Loading.Aspx?Page="TheFinishedP age.aspx")


What this does is this:

The Loading.aspx page gets called and will be loaded on the client, and the
client will sit there until the code in TheFinishedPage.aspx has completed
executing. When TheFinishedPage.aspx completes, the client is sent to that
page, where you can display some kind of confirmation message, etc.

You must, however, use session variables or something else like a db to
store the information from the page you are transferring from so that
TheFinishedPage.aspx will know what to do.

It's a convenient way to have a message like "Loading. Please Wait..." so
that the user cannot click any more controls that will post back to the
server.

Steve
"Diane Selby" <so*************@yahoo.com> wrote in message
news:29**************************@posting.google.c om...
Hi-

I am developing an ASP.NET application that can take a few seconds to
process the request from the user. We are looking for a client-side
solution that will prevent users from resubmitting the page multiple
time in their irrational impatience.

There are a few posts on this group which suggest that we use
JavaScript hooked up to the page's OnSubmit event to catch mulitple
submissions. See postings by Craig Deelsnyder et alia.

But, and here is the catch... The OnSumbit event only gets called if
the user clicks a Submit button. And unfortunately we have an
application with dozens of pages, but nary a single Submit button. We
use linkbuttons hooked up to events pretty much everywhere to do our
saving (which seems to be standard practice) and linkbuttons do not
trigger OnSubmit.

Any suggestions on how to popup a "We are working on your request,
please stop clicking" dialog?

Diane "America's Developer" Selby

Nov 18 '05 #3
Steve-

Redirecting to another page is a solution, but maybe not the solution
we are looking for. In most cases, we want to display the same page
after the button click. So, heading off to a "please wait" page and
then back to the original page would be a bit bewildering for the
user. I could see lots of complaints about that...

What I'm dreaming of is a JavaScript client side method that will pop
up an alert if the user clicks the button more than once before the
results return. We may have to wire up a script to each button, but
I'd rather have something that would work on a page level somehow...

Anyhow, if anyone has something they can suggest, that would be fresh,
yo!

DD
"Steve Caliendo" <sc*******@epion.com> wrote in message news:<eV**************@TK2MSFTNGP10.phx.gbl>...
What you need to do is redirect to another page when the user clicks the
button. This way the client immediately sees a "please wait" page.

Place this when the button is clicked:

Response.Redirect("Loading.Aspx?Page="TheFinishedP age.aspx")


What this does is this:

The Loading.aspx page gets called and will be loaded on the client, and the
client will sit there until the code in TheFinishedPage.aspx has completed
executing. When TheFinishedPage.aspx completes, the client is sent to that
page, where you can display some kind of confirmation message, etc.

You must, however, use session variables or something else like a db to
store the information from the page you are transferring from so that
TheFinishedPage.aspx will know what to do.

It's a convenient way to have a message like "Loading. Please Wait..." so
that the user cannot click any more controls that will post back to the
server.

Steve
"Diane Selby" <so*************@yahoo.com> wrote in message
news:29**************************@posting.google.c om...
Hi-

I am developing an ASP.NET application that can take a few seconds to
process the request from the user. We are looking for a client-side
solution that will prevent users from resubmitting the page multiple
time in their irrational impatience.

There are a few posts on this group which suggest that we use
JavaScript hooked up to the page's OnSubmit event to catch mulitple
submissions. See postings by Craig Deelsnyder et alia.

But, and here is the catch... The OnSumbit event only gets called if
the user clicks a Submit button. And unfortunately we have an
application with dozens of pages, but nary a single Submit button. We
use linkbuttons hooked up to events pretty much everywhere to do our
saving (which seems to be standard practice) and linkbuttons do not
trigger OnSubmit.

Any suggestions on how to popup a "We are working on your request,
please stop clicking" dialog?

Diane "America's Developer" Selby

Nov 18 '05 #4
On 25 Jun 2004 14:39:20 -0700, so*************@yahoo.com (Diane Selby)
wrote:
Steve-

Redirecting to another page is a solution, but maybe not the solution
we are looking for. In most cases, we want to display the same page
after the button click. So, heading off to a "please wait" page and
then back to the original page would be a bit bewildering for the
user. I could see lots of complaints about that...

What I'm dreaming of is a JavaScript client side method that will pop
up an alert if the user clicks the button more than once before the
results return. We may have to wire up a script to each button, but
I'd rather have something that would work on a page level somehow...

Anyhow, if anyone has something they can suggest, that would be fresh,
yo!

DD


add something like this

System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("if (typeof(Page_ClientValidate) == 'function') { ");
sb.Append("if (Page_ClientValidate() == false) { return false; }} ");
sb.Append("this.value = 'Wait...';");
sb.Append("this.disabled = true;");
sb.Append(this.Page.GetPostBackEventReference(this .<buttonname>));
sb.Append(";");
this.<buttonname>.Attributes.Add("onclick", sb.ToString());

remeber to change <buttonname> to the actual name of u're button.

-Adam

Nov 18 '05 #5

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

Similar topics

7
2102
by: Matt | last post by:
I have an interactive web page that I need to prevent refreshes on. The problem is that I want to ALLOW resubmissions, but only via the submit button. My web page has two forms on it, one form for...
12
8853
by: Forti2ude | last post by:
Hello, I have a simple form... <form> <select name="foo" multiple> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select>
1
2572
by: Adam Smith | last post by:
Have a lot of data to collect / choices presented, producing a large form. I am desirous of breaking it up into multiple pages to avoid detracting users. Could some one say how best to create...
3
13087
by: Mark | last post by:
This is a solution... Often users want to keep clicking "submit" when they are waiting for server processing. Most apps these days like to disable the submit button to prevent this. You can't just...
3
2126
by: Tina | last post by:
I have an aspx page with a textbox and an "add to my Account Button." when the button is pushed, my program adds the amount in the textbox to the database which, lets say takes a few seconds. If...
0
1284
by: Marc DVer | last post by:
I am at kind of a loss on how to design a certain database project I am working on. Basically, we have a proprietary program with a standard backend (though we do not have direct write access to...
12
2123
by: Mark Rae | last post by:
Hi, See the previous thread Request.Form abuse in this newsgroup... I'm looking for a simple and efficient way to prevent people hijacking the <formtags on my websites and using them to send...
6
11863
by: Oleg Konovalov | last post by:
Hi, I have a Java/JavaScript GUI application where I perform a lot of long DB operations , which takes 5-60 secs to perform. Sometimes user double-clicks the button or just gets impatient and...
9
2885
by: Ned White | last post by:
Hi All, Im my c# web project, users click a submit button for credit card payment process. On the web server side ( on ButtonClick_Event) the user's input(name,date,cc number etc.) is processed...
0
7132
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
7223
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...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.