>
>When I set this property, I want to set all its inner controls Enabled property to the passed value.
You can iterate over the Controls collection to do this.
>Also can I have this as a static method in our public static class? If yes, what should I pass to this method?
Sure. You could pass in either a UserControl, or a ControlCollection.
public static void SetEnabled(ControlCollection cc, bool enabled)
{
foreach (Control control in cc)
{
WebControl webControl = control as WebControl;
if (webControl != null)
webControl.Enabled = enabled;
}
}
This isn't recursive, but should point you in the right direction.