How to Get list of controls inside a specific div in ASP.NET
A:
Providing your div has an ID attribute (say yourDiv) and runat="server", and providing you're using C#, try:
for (int i = 0; i < yourDiv.Controls.Count; i++)
{
Console.WriteLine(yourDiv.Controls[i].ToString());
}
to list the types of the controls contained within the div.
Brissles
2010-09-20 11:46:08
A:
Every asp.net Control has a parameter Controls
foreach ( Control ctrl in myDivCtrl.Controls ) { string ctrlId = ctrl.ID; }
ibram
2010-09-20 11:51:45