Open Sourcing DOS 4
4 days ago
public static void ResetControls(ControlCollection pagecontrols, bool txtbox, bool dropdownlist, bool label)
{
foreach (Control cntrl in pagecontrols)
{
foreach (Control mycontrols in cntrl.Controls)
{
if (txtbox)
{
if (mycontrols is TextBox)
{
(mycontrols as TextBox).Text = string.Empty;
}
}
if (dropdownlist)
{
if (mycontrols is DropDownList)
{
(mycontrols as DropDownList).SelectedIndex = 0;
}
}
if (label)
{
if (mycontrols is Label)
{
(mycontrols as Label).Text = string.Empty;
}
}
}
}
}
FormControl.ResetControls(this.Controls, true, true, false);
Post a Comment