473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Stopping multiple postbacks ?

Say you have a webform with some fields and a button on it. When the user
clicks the button, the buttonclicked event gets fired on the server, it does
some processing, which includes creating some db records, and then redirects
the page. What is happening sometimes is that the server is a bit slow and
the page seems to sit there, so the user presses the button again, which
causes the server event to fire again, and so more records get created in
the DB. How can I stop the button firing an event once it has already done
so ?

Thanks
Adrian
Nov 19 '05 #1
2 1252
Hi Parker,
Try to add a javascript function onClick to the button and
1)Hide the button on click in javascript like
document.getElementById("Button1").style.visibilit y = "hidden";(PS: this
script works in IE.)
2)Show some friendly text in the place of the button like "Processing..." so
that the user will not panic
--
HTH
srini
http://www.expertszone.com
"Adrian Parker" wrote:
Say you have a webform with some fields and a button on it. When the user
clicks the button, the buttonclicked event gets fired on the server, it does
some processing, which includes creating some db records, and then redirects
the page. What is happening sometimes is that the server is a bit slow and
the page seems to sit there, so the user presses the button again, which
causes the server event to fire again, and so more records get created in
the DB. How can I stop the button firing an event once it has already done
so ?

Thanks
Adrian

Nov 19 '05 #2
Thanks srini, that works a treat!

"srini" <sr***@discussions.microsoft.com> wrote in message
news:90**********************************@microsof t.com...
Hi Parker,
Try to add a javascript function onClick to the button and
1)Hide the button on click in javascript like
document.getElementById("Button1").style.visibilit y = "hidden";(PS: this
script works in IE.)
2)Show some friendly text in the place of the button like "Processing..."
so
that the user will not panic
--
HTH
srini
http://www.expertszone.com
"Adrian Parker" wrote:
Say you have a webform with some fields and a button on it. When the
user
clicks the button, the buttonclicked event gets fired on the server, it
does
some processing, which includes creating some db records, and then
redirects
the page. What is happening sometimes is that the server is a bit slow
and
the page seems to sit there, so the user presses the button again, which
causes the server event to fire again, and so more records get created in
the DB. How can I stop the button firing an event once it has already
done
so ?

Thanks
Adrian

Nov 19 '05 #3

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

Similar topics

3
by: Damon | last post by:
I am working on a site in which I would like to have two dropdowns that will allow a user to navigate through the administrative pages of the site. The first would allow the user to choose the...
2
by: KV | last post by:
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...
4
by: Diane Selby | last post by:
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...
4
by: Davids | last post by:
in my small hangman web project I have a Hangman class which has some methods and properties (int GuessAttempts, string GuessedLetters etc..) which change as the game goes on... Best of all would...
3
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...
9
by: Jamie | last post by:
I am receiving an Invalid ViewState error after posting back to the same page twice. Consistently the error occurs after the second postback and not after the first. I have looked into creating...
1
by: Mardy | last post by:
I have an application where, in a few cases, I can hear more than one click by the browser on a post back. I also see the IE progress bar appear twice consecutively. This happens for example when I...
5
by: jediknight | last post by:
Is it possible to programmatically stop multiple browsers from getting the same session state? The problem I have is that whenever I open a new browse using File- I would like to stop this...
4
by: Nathan Sokalski | last post by:
I have 2 private variables in my class that I need to remember the values of between postbacks (or actually callbacks, since I am using AJAX). I want to avoid using session variables, if possible....
0
by: Mike P | last post by:
I have a form that I using to add details to an array, but I need to continue to add these details to my array on multiple postbacks....how can I do this? Do I need to use a Session object instead?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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,...
0
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...

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.