Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 23, 2012 03:22 AM by Steven Cheng - MSFT
Apr 19, 2012 10:16 AM|LINK
i want to response to Just one request on each requst
means i send a request to server... IMMEDIATE i send (click on same btn ) a request again...
how can i prevent it ? (is it possible via HttpHandler ? if yes HOW ?)
i see it in a Bank Site
when i click on show Credite , and click again on it , site shows me a warning : your last request's not finished yet
please help me
Apr 19, 2012 10:33 AM|LINK
I have used the jquery plug in blockui to prevent a user from submitting any more requests until the current one finishes
Apr 20, 2012 03:57 PM|LINK
hide that button after it is clicked once and successfully request sent to server. and after the response comes back from server. you may show it to the user again.
Apr 21, 2012 02:13 PM|LINK
Suppose your button name is "btnSave". Then use this code into codebehind PageLoad
btnSave.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(btnSave, null) + ";");
There are also a lot of way to do this.....
Apr 23, 2012 03:22 AM|LINK
Like other members suggested, you should consider a client-side script based approach to prevent the service request be invoked for multiple times.
For example, if you're using a button to trigger the AJAX websevice call, then you can declare a global script variable which indicate whether the AJAX service call is inprogress. And you will set the variable to true before the AJAX call starts, and reset
it to false after the AJAX call's complete callback handler is executed.
var isSvcCallInProgress = false;
if(isSvcCallInProgress == true) return;
isSvcCallInProgress == true;
// Do Ajax service call here (and don't forget to reset the isSvcCallInProgress variable to false in the complete callback no matter succeed or fail)