If you want to disable all the controls on a Master Page, just do the following:
DisableControls(this.Page.Master, isEnable);
Or, if you want to perform the method on a specific MasterPage contorl:
DisableControls(this.Page.Master.FindControl("Panel1"), isEnable);
Update:
Why don't you just put a method on your MasterPage:
public void SetControlEnabledState(bool enabled)
{
DisableControls(Menu1, enabled);
DisableControls(Control2, enabled);
}
Then, to access it, just do the following from any page that uses the master page:
((MasterPageName)this.Page.Master).SetControlEnabledState(enabled);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…