double click asp.net button

I am having a problem where a client is sometimes double clicking on a button on my web app page and this is causing two entries in my database. I've found a few long winded approaches to solving this, anyone got a simple up to date solution?

Thanks
LVL 2
Paulmc999Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
Disable the button via Javascript during the click event, perhaps?
0
guru_samiCommented:
I think every developer faces this issue sometime. As mentioned by @Kaufmed disabling the button is one way. Here's an example.

- In addition, I sometimes add a overlay message informing the user something is being process and block the entire screen.

- I have seen certain websites explicitly informing user to click the button only once.
0
Johny BravoCommented:
A simple approach might be, check it in your stored procedure
Create procedure addData
@name varchar(50),
@add varchar(50),
@email varchar(50)
As
Begin
If Not exists(select * from yourtable where name != @name and email != @email)
Begin
insert into yourtable (----------)
End

End
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Monica PSoftware DeveloperCommented:
Hi

Check this :

You can make use of  OnClientClick and UseSubmitBehavior properties of the button control. There are other methods, involving code on the server side to add attributes,

http://encosia.com/disable-a-button-control-during-postback/
0
Paulmc999Author Commented:
The DB INSERT solution was the neatest to implement and fixed problem immediately. Thanks guys.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.