Enumerate all controls in the form

private void EnableControls(bool enable)
            foreach (TextBox t in Page.Form.Controls.OfType<TextBox>())
                t.ReadOnly = !enable;
            chkSameAsCurrent.Enabled = enable;

The above code runs fine in a simple page not having any master page, but if I run it in a ContentPage I can not enumerate the TextBoxes and not even any control in the form.


Try this. I think this should work.

 private void RecursiveLoopThroughControls(Control root)
      foreach (Control control in root.Controls)
          //process the control.

Call the method using


Need Your Help

When deploying Jasper Reports getting error message

jasper-reports ireport jasperserver

Hi I created a simple report using iReport 4.5.1 and when I tried to deploy the report in JasperSoft (Ver 4.5) I am getting the following error message even thought I am selecting the correct JRXML...

Copy a subtree in the nested set model Java/MySQL

mysql java tree

I'm using a nested set model to represent tree folders in a program. The table structure is :