Monday, February 21, 2005

disabling buttons in javascript with asp.net

Here is how to call Javascript that will disable a button after it is clicked to prevent double submission. The problem is that if you just disable it in javascript it messes up the postback.

LoginButton.Attributes.Add("onClick", "disableButtons();" +
GetPostBackEventReference(LoginButton).ToString());