This kind of scenario is required when doing a transaction. User clicks on the complete transaction button and we need the user avoid from clicking on the button again. Below code demonstrate how we can achieve this in ASP.NET.
in the code behind on Button1_Click1 we can enable the button at the end of the task.
protected void Button1_Click1(object sender, EventArgs e)
{
Thread.Sleep(700); // Process
Button1.Enabled = true;
}
function DisableMe(id) {
document.getElementById(id).disabled = true;
}
protected void Button1_Click1(object sender, EventArgs e)
{
Thread.Sleep(700);
Button1.Enabled = true;
}
No comments:
Write comments