Monday, 7 January 2013

To count controls Names in page in asp.net

foreach (Control c in Page.Controls)
        {
            if (c.Controls.Count > 0)
            {
                foreach (Control c2 in c.Controls)
                {
                    lbl.Text += c2.GetType().Name + "<br/>";                  
                }
            }
        }

No comments:

Post a Comment