This is a generic method to avoid "double-click" effect where a user click many times to validate. The button is hidden when the user clicks it. In order to not update all forms, the trick is applied to the Render event of the page.
protected override void Render(HtmlTextWriter output) {
// Get normal html ouput
StringBuilder stringBuilder = new StringBuilder();
StringWriter stringWriter = new StringWriter(stringBuilder);
HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
base.Render(htmlWriter);
string html = stringBuilder.ToString();
// Enhance submit buttons
string onclick1 = "\"if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate();";
string onclick2 = "\"this.style.display='none';";
html = html.Replace("onclick=" + onclick1, "onclick=" + onclick2 + onclick1.Substring(1));
// Render updated html
output.Write(html);
}