Sunday, March 11, 2012

Dealing with over enthusiastic users...

One way will be to display a progressbar, which will perhaps give the user the impression that something is going on. Or you can disable the buttons unless the processing is complete.

Hope that will help you.


I'm guessing the disabling will need to take place on the client, as the buttons won't update until the whole asynchronous call is completed...
You could always use the animation extender from the toolkit and have the buttons disappear when the cancel button is clicked.

What about disabling the other button with some client script?

<scripttype="text/javascript"language=javascript>
function btnDisable(button){
$get(button).disabled=true;
returntrue;
}
</script><asp:ButtonID="btnSave"runat="server"Text="Save"OnClientClick="javascript:btnDisable('btnCancel');"/>
<asp:ButtonID="btnCancel"runat="server"Text="Cancel"OnClientClick="javascript:btnDisable('btnSave');"/>

You would most likely still want to have some check on the server side, but this approach would prevent impatient users from clicking Cancel. You could also disable the button submitting the form with something like:

<scripttype="text/javascript"language=javascript>
function btnDisable(button){
__doPostBack(button,'');
$get(button).disabled=true;
returntrue;
}
</script>

No comments:

Post a Comment