Link to home
Start Free TrialLog in
Avatar of MiBlg
MiBlg

asked on

Prevent Submit Button Clicked Twice.

Hi,

How to prevent user to click a submit button more than once?
I've seen some sites disabled the button once it's clicked. Could

somebody tells me how to do that? Or any other solutions?

Thanks in advance,

Hendry
ASKER CERTIFIED SOLUTION
Avatar of tovvenki
tovvenki

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jnhorst
jnhorst

Another possibility is to set Enabled = false on the submit button, assuming the submit button is a server-side button control.  Do this on it's click event.

private void Button1_Click(object sender, System.EventArgs e)
{
     // code for whatever needs to be accomplished when the button is clicked.
     ... code here.

     // disable this button once the code has executed.
     Button1.Enabled = false;      
}

John
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial