DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Mike has posted 9 posts at DZone. View Full User Profile

Stopping Double Submits

06.10.2008
| 1924 views |
  • submit to reddit
        

        Dim sb As New System.Text.StringBuilder()
        sb.Append("if (typeof(Page_ClientValidate) == 'function') { ")
        sb.Append("if (Page_ClientValidate() == false) { return false; }} ")
        sb.Append("this.value = 'Please Wait...';")
        sb.Append("this.disabled = true;")
        sb.Append(Me.Page.GetPostBackEventReference(Me.btnSubmit))
        sb.Append(";")
        btnSubmit.Attributes.Add("onclick", sb.ToString())