Reputation: 18
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
Reputation: 8271
Try to add UseSubmitBehavior
attribute to asp:Button
UseSubmitBehavior="false"
OnClientClick="this.disabled='true' ; this.value= 'Please Wait..';"
Upvotes: 1