Saturday, March 21, 2009

To select All Controls from a Page

/// To select All Controls from a Page
foreach (Control ctr in Page.Form.Controls)
{
if (ctr is DropDownList)
{
DropDownList x = (DropDownList)ctr;
x.SelectedIndex = 1;
}

}