예제 #1
0
        private void ListControlsInPanel()
        {
            var theInfo = "";

            theInfo = $"<b>Does the panel have controls? {MyPanel.HasControls()} </b><br/>";
            //Get all the controls in the panel
            foreach (Control control in MyPanel.Controls)
            {
                if (!object.ReferenceEquals(control.GetType(), typeof(System.Web.UI.LiteralControl)))
                {
                    theInfo += "**************<br>";
                    theInfo += $"Control Name: {control}<br>";
                    theInfo += $"ID? {control.ID} <br>";
                    theInfo += $"Control Visable? {control.Visible}<br>";
                    theInfo += $"ViewState? {control.ViewStateMode}<br>";
                }
            }
            lblControlInfo.Text = theInfo;
        }