Reputation: 26121
I'm trying to prevent a form from being submitted multiple time. It uses a validation summary so I am overriding the OnClientClick event for the submit button. It works as expected, the window showing the list of errors is being loaded multiple times.
<asp:Button ID="btnSubmit" runat="server"
Text="Submit"
CausesValidation="False"
ValidationGroup="vgApplication"
OnClientClick=" if ( Page_ClientValidate() ) { this.value='Submitting..'; this.disabled=true; }"
/>
Upvotes: 0
Views: 304
Reputation: 26121
The problem was that I have multiple ValidationGroups on my form. So I had to specify which ValdationGroup to run by passing in the name to Page_ClientValidate()
.
<asp:Button ID="btnSubmit" runat="server"
Text="Submit"
CausesValidation="False"
OnClientClick=" if ( Page_ClientValidate('vgApplication') ) { this.value='Submitting..'; this.disabled=true; }"
/>
Upvotes: 1