Finding Particular Controls in Page
private Control FindNestedControl(Control parent, string controlid)
{
Control c = parent.FindControl(controlid);
if (c != null)
return c;
else
{
foreach (Control child in parent.Controls)
{
c = FindNestedControl(child, controlid);
if (c != null)
return c;
}
}
return null;
}
Eg :- DropDownList ddlMyList = FindNestedControl(this.Page," ddlMyList") as DropDownList;
15 September, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment