Total Pageviews

Monday, October 19, 2015

Disable multiple button clicks

Call on the Page_Load

 PreventMultipleClicksforContinue(ibContinueStep0)

Below method adds JAVAScript code to the on click event

    Public Shared Sub PreventMultipleClicksforContinue(ByRef button As System.Web.UI.WebControls.Button)
        button.Attributes.Add("onclick", "if (Page_ClientValidate()) { this.disabled=true;}" & button.Page.ClientScript.GetPostBackEventReference(button, String.Empty).ToString)
    End Sub

No comments:

Post a Comment