user228777
user228777

Reputation: 3094

Disabling controls on a nested user control

I am using a masterpage. On a accounts page I have a Usercontrol on this UserControl I have one more user control. If Account is closed I want to Disable all the controls on Accounts page ( including parent and child userControl – controls collection). How do I do this? Thanks

Upvotes: 1

Views: 1203

Answers (1)

Brian Mains
Brian Mains

Reputation: 50728

Wrap the section with an Panel control. Then set panel.Enabled = false;. This will trickle down and disable its children too.

HTH.

Upvotes: 1

Related Questions