1

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

Fredrik Mörk
  • 155,851
  • 29
  • 291
  • 343
user228777
  • 3,082
  • 9
  • 33
  • 50

1 Answers1

1

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

HTH.

Brian Mains
  • 50,520
  • 35
  • 148
  • 257
  • Is there way If I can disable form on a master page to achieve same thing? – user228777 Jul 27 '10 at 13:58
  • I don't know about the form element; you can try, but you can also try to put a panel just inside the form so that it wraps everything, and add a property in the master page that changes the enabled property, which you can call in your code via this.Master (cast to the correct type though). – Brian Mains Jul 27 '10 at 15:38