Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void PreventDoubleClick(Page page, Button button, string message)
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("if (typeof(Page_ClientValidate) == 'function') { ");
- sb.Append("if (Page_ClientValidate() == false) { return false; }} ");
- sb.Append("this.value = '" + message + "';");
- sb.Append("this.disabled = true;");
- sb.Append(page.ClientScript.GetPostBackEventReference(button, String.Empty));
- sb.Append(";");
- button.Attributes.Add("onclick", sb.ToString());
- }
Add Comment
Please, Sign In to add comment