I have this code
private void ResetFormValues(Control parent)
{
foreach (Control c in parent.Controls)
{
if (c.Controls.Count > 0)
{
ResetFormValues(c);
}
else
{
switch (c.GetType().ToString())
{
case "System.Web.UI.WebControls.TextBox":
((TextBox)c).Text = "";
birthdate.Text = "mm/dd/yyyy";
break;
case "System.Web.UI.WebControls.CheckBoxList":
CheckBoxList check = (CheckBoxList)c;
for (int i = 0; i < check.Items.Count; i++)
{
check.Items[i].Selected = false;
}
break;
case "System.Web.UI.WebControls.RadioButton":
((RadioButton)c).Checked = false;
break;
}
}
}
Radiobutton and checkboxlist doesn't work..