You should figure out what the controls are on the first floor.
The control we are looking for is generally on the fourth floor site1_master---contentplaceholder---HtmlForm---CheckBox
First floor is site1_master, master
The second floor is ContentPlaceHolder, which is the ' pit ' of the master version,
The third layer is HtmlForm, which is the HTML form,
The fourth layer is the child control.
So you have to iterate.
The following example uses a multi-layered traversal to find a checkbox in a page and lists each layer name
String S= "";
for (int i = 0; i < Page.Controls.Count; i++) all controls in//site1_master
{
foreach (Control conn in page.controls[i]. Controls)//traversing in Site1_master, looking for ContentPlaceHolder
{
foreach (Control con in Conn. Controls)//Traversal in ContentPlaceHolder, looking for HtmlForm
{
foreach (Control C in con. Controls)//traversing in HtmlForm, looking for a checkbox
{
if (C.gettype (). Name.equals ("checkbox"))
{
S=conn. GetType (). Name + "---" + con. GetType (). Name + "---" + c.gettype (). Name;
}
}
}
}
}
Novice, there are errors please correct me, thank you!
Controls that traverse the page of the Application Master page in ASP.