Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
How can i do,

on btn click event disable the btn control and also call btn click event in that enable btn control .

protected void Button1_Click(object sender, EventArgs e)
{
Button1.Enabled = false;
}
above code not work in IE ,Mozilla,Chrome
Posted
Updated 25-Apr-12 5:53am
v2
Comments
A. Orozco 25-Apr-12 11:44am    
Are you trying to disable the button to prevent the user from clicking twice? In that case I suggest you use javascript to disable it and then trigger the server side code.

1 solution

protected void Button1_Click(object sender, EventArgs e)
{
    Button1.Enabled = false;
}


that would disable the button u just clicked

C#
protected void Button1_Click(object sender, EventArgs e)
        {
            Button1.Enabled = false;
        }


this would hide the button

what do u mean by
"also call btn click event in that enable btn control "
 
Share this answer
 
Comments
[no name] 25-Apr-12 11:42am    
You might want to improve your answer before the univotes start pouring in.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900