Noumaan
Noumaan

Reputation: 18

asp.net button click event firing twice in Firefox

I have an asp.net button inside UpdatePanel. Sometimes it's click event fire twice and generate duplicate records. My button declaration is..

<asp:Button ID="btnSave" runat="server" onclick="btnSave_Click" Text="Save"/>

and code behind is...

protected void btnSave_Click(object sender, EventArgs e)
{
   SaveData();
}

Any help would be appreciated.

Upvotes: 0

Views: 1499

Answers (1)

Tummala Krishna Kishore
Tummala Krishna Kishore

Reputation: 8271

Try to add UseSubmitBehavior attribute to asp:Button

UseSubmitBehavior="false" 
OnClientClick="this.disabled='true' ; this.value= 'Please Wait..';"

Upvotes: 1

Related Questions