Advertisement
Guest User

Untitled

a guest
May 25th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. protected void ButtonBlocker(Control Parent)
  2. { //Set all buttons on page to not enabled
  3. //Call by using ButtonBlocker(Page);
  4. foreach (Control c in Parent.Controls) //Loop through the controls on the page
  5. {
  6. Button bt = c as Button; if (bt != null)
  7. {
  8. bt.Enabled = false; //Set the buttons to not enabled.
  9. //c.Visible = false; //Uncomment to make the buttons invisible.
  10. }
  11. if (c.HasControls()) { ButtonBlocker(c); }
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement