Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Method to set all controls Enabled property to false
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01319086
Message ID:
01319094
Views:
18
>>
>>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.

Thanks a lot, I'll proceed from there.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform