Thread: ASP.NET/Double submit problem

Double submit problem
Possible solution



Re: Double submit problem

JavaScript

function DisableButton(buttonElem) {

buttonElem.value = 'Please Wait...';

buttonElem.disabled = true;

}


ASPX

<asp:button id="btnSubmit" runat="server" Text="Submit" />


C# Code

protected void Page_Load(object sender, EventArgs e)

{

btnSubmit.Attributes.Add("onclick", "DisableButton(this);" +

Page.ClientScript.GetPostBackEventReference(this,

btnSubmit.ID.ToString()));

}