Reply to comment

Problems with this...

This does not work when there are validator controls on the page. To fix this, add the following lines to the start of the javascript function (before the line 'oButton.disabled = true;'):

if (typeof(Page_ClientValidate) == 'function')
if (Page_ClientValidate() == false)
return false;

Also, I have found intermittent problems with the button's server-side click event handler firing twice (it seems to happen on our production server where the postback round-trip takes longer than on my dev PC). To fix this, add a "return" to the end of the button's OnClientClick property:

btnSubmit.OnClientClick = "disableButtonOnClick(this, 'Please wait...', 'disabled_button'); ";
btnSubmit.OnClientClick += ClientScript.GetPostBackEventReference(optionsSubmit);
btnSubmit.OnclientClick += "; return;";

Hope this helps someone

Andy

Reply