So here is my solution for disabling a submit button on an AJAX request using an update panel.
var prm = Sys.WebForms.PageRequestManager.getInstance();prm.add_initializeRequest(InitializeRequestHandler);prm.add_endRequest(EndRequestHandler);function InitializeRequestHandler(sender, args){document.getElementById('<% Response.Write(submitButton.ClientID); %>').disabled = true;}function EndRequestHandler(sender, args){document.getElementById('<% Response.Write(submitButton.ClientID); %>').disabled= false;}
So i think this is a nice elegent solution. Uses javascript events being fired off by the Updatepanel.
No comments:
Post a Comment