Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when I set the visible of The button to false The click event does not work
asp code
VB
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button"
            Visible="False" />

code behind
C#
protected void Button1_Click(object sender, EventArgs e)
        {
            Button1.Visible = true;
        }
    }

and when I press on The button place in The browser It do't appear
Posted

Not visible also means that it behaves as if it wasn't there. So it's just normal behaviour what you're getting.
 
Share this answer
 
The click event gets executed only when you click the button. if the visible property of the button is false how will you click the button and how could the event be executed.

VB
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button"/>


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


this is what should be executed.
 
Share this answer
 

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