Using Lock in asp.net how can i prevent more than one user to click on button. I mean only one user has to click on button at a time, more than one user not to click on button.
How can i use lock, any refrence to study.
Using Lock in asp.net how can i prevent more than one user to click
Share
You cannot really prevent different users from clicking “the same” button on “the same” page. But you can prevent several requests from being active in the same code block at the same time:
Although this would serialize access to the code in
Button1_Click, I would advise against using ti if it’s not absolutely necessary. Thelockstatement blocks (potentially forever) until the previous lock holder releases the lock.