protected void StoreSelectedDates()
{
Control[] allControls = FlattenHierachy(Page);
foreach (Control control in allControls)
{
CheckBox mycheckBox = control as CheckBox;
if (mycheckBox != null)
{
if (mycheckBox.Checked)
{
try
{
string setDay = mycheckBox.ID.Substring(3);
}
catch (Exception ex)
{}
}
}
}
private Control[] FlattenHierachy(Control root)
{
List
list.Add(root);
if (root.HasControls())
{
foreach (Control control in root.Controls)
{
list.AddRange(FlattenHierachy(control));
}
}
return list.ToArray();
}
No comments:
Post a Comment