Guest User

Untitled

a guest
Jul 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public static void PreventDoubleClick(Page page, Button button, string message)
  2. {
  3. StringBuilder sb = new StringBuilder();
  4. sb.Append("if (typeof(Page_ClientValidate) == 'function') { ");
  5. sb.Append("if (Page_ClientValidate() == false) { return false; }} ");
  6. sb.Append("this.value = '" + message + "';");
  7. sb.Append("this.disabled = true;");
  8. sb.Append(page.ClientScript.GetPostBackEventReference(button, String.Empty));
  9. sb.Append(";");
  10. button.Attributes.Add("onclick", sb.ToString());
  11. }
Add Comment
Please, Sign In to add comment