Tuesday 8 January 2013

Disable Button Double Click in ASP.NET


Disable Button Double Click in ASP.NET


Add following code to Page_load. This code prevents button double-click on client-side but still executes code at server-side: 

C#

btnNew.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(btnNew, null) + ";");   

VB.Net

btnNew.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(btnNew, Nothing) + ";") 

4 comments:

Thank You for Your Comments. We will get back to you soon.

back to top