A Web Control is visible when the page loads and visible again on postback, but when debugging code, the control's visibility property is set to False.
A method call should fire if the control is visible when a button is clicked, but since the property is not set correctly, the method is not called.
When a control's visibility property is set to true, it will only be visible if all parent controls that contain it also have their visiblity set to true.
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="MyPage.aspx.vb" Trace="true" Inherits="DevCorner.MyPage"%>
Private Sub btnTopic_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnTopic.Click trTopics.Visible = ddlArea.SelectedIndex > 0 pnlTopics.Visible = cblTopics.Items.Count > 0 Dim s As String = "<B>settopicvisible:</B> <BR>pnlIssueForm: " & pnlIssueForm.Visible.ToString s &= "<BR>trTopics: " & trTopics.Visible.ToString s &= "<BR>pnlTopics: " & pnlTopics.Visible.ToString s &= "<BR>cblTopics: " & cblTopics.Visible.ToString Literal1.Text = Literal1.Text & "<BR>" & s End Sub
When events such as the button click above fire, they will concatenate with the literal string. This will display the different visibility properties for each of the controls after each of the relevant events fire.