0
protected void btnsave_Click(object sender, EventArgs e)
{
    btnsave.Enabled = false;
    .
    . // processing code


    btnsave.Enabled = true;
}

But the button never gets disabled? I just want to avoid multiple clicks (avoid data redundancy)? (Even if there is an update panel, calling UpdatePanel.Update() makes no change)

gjijo
  • 1,206
  • 12
  • 15

1 Answers1

0

You can do it using below code:

OnClientClick="this.disabled='true';return true;"

Possible duplicates of

How do I prevent users clicking a button twice?

I hope it will help you. :)

Community
  • 1
  • 1
Hitesh
  • 3,508
  • 1
  • 18
  • 24
  • where should this code be called? Inside the click event? or aspx page? Do this return true prevent remaining code from getting excecuted? – gjijo Oct 29 '13 at 08:40
  • add this code in the aspx page in the button tag and return true will make the further call to server side coding. – Hitesh Oct 29 '13 at 14:06