Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button.Click

Status
Not open for further replies.

NaiDanac

Programmer
Mar 25, 2004
96
US
I've got a strange problem. I have server controls in my .aspx page, but they don't seem to fire up.

For example, I have two controls, button1 and button2. When I click on button1, button2.visible = false.

If I put that code in the button1_click procedure it doesn't do much:

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button2.Visible = False
    End Sub

However, when I put the Button2.Visible = False in the page load sub procedure, it does get executed (when the page loads)

Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
.....
        Button2.Visible = False
....

Any reason why?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top