foreach (Control ctrl in Page.Controls)
{
findCtrl(ctrl);
}
public void findCtrl(Control ctrlTry)
{
if (ctrlTry.HasControls()) // if the control contrains other controls
{
if (ctrlTry.ID != null && ctrlTry.ID != "") // control has a ID-name
{
Response.Write(ctrlTry.ID + "<BR>");
}
foreach (Control lastCtrl in ctrlTry.Controls)
{
findCtrl(lastCtrl);
}
}
else
{
if (ctrlTry.ID != null && ctrlTry.ID != "")
{
Response.Write(ctrlTry.ID + "<BR>");
}
}
}
I've placed some radtextboxes in a Formview and used a table in the EditItemTemplate for design-reasons.
But then I can't use this approach.
<asp:FormView ID="FormView1" runat="server"
DataSourceID="sdsMeHaulier"
DataKeyNames="HaulierID"
DefaultMode="Edit"
onitemupdated="FormView1_ItemUpdated" >
<EditItemTemplate>
<table id="tblHaulier">
<tr>
<td valign="top">
<telerik:RadTextBox ID="tbHaulierName" runat="server"
Label="HaulierName"
Text='<%# Bind("HaulierName") %>'
Enabled="true"
EnableTheming="True"
ReadOnly="false" >
</telerik:RadTextBox>
<br />
<telerik:RadTextBox ID="tbDepName" runat="server"
Label="DepName"
Text='<%# Bind("DepName") %>'
Enabled="true"
EnableTheming="True"
ReadOnly="false"
and so on.
None of the radtextboxes appear in the list of controls.
Any ideas?