Вы можете перебрать все элементы управления (вложенные):
private void SetEnableControls(Control page, bool enable)
{
foreach (Control ctrl in page.Controls)
{
// not sure exactly which controls you want to affect so just doing TextBox
// in this example. You could just try testing for 'WebControl' which has
// the Enabled property.
if (ctrl is TextBox)
{
((TextBox)(ctrl)).Enabled = enable;
}
// You could do this in an else but incase you want to affect controls
// like Panels, you could check every control for nested controls
if (ctrl.Controls.Count > 0)
{
// Use recursion to find all nested controls
SetEnableControls(ctrl, enable);
}
}
}
Затем просто сначала вызовите его, чтобы отключить:
SetEnableControls(this.Page, false);