title: Loop Through Controls on Web User Control
body: <p>I'm having problems looping through controls that are on my user control.</p>
  
  <p>I have tried the following code, but cannot get it to find the checkboxes that are on the user control.  (You can see some of my previous attempts that I have commented out.)</p>
  
  <pre><code>    'For Each Ctrl As Control In Page.Controls
      'For Each Ctrl As Control In Me.Page.Controls
      'For Each ctrl As Control In Request.Form
       '''Dim frm As Control = Me.FindControl("frmDefault")
       '''For Each Ctrl As Control In frm.Controls
  
      Dim Check As CheckBox
  
      For Each Ctrl As Control In Me.Controls
          If TypeOf Ctrl Is CheckBox Then
              Check = Ctrl
              ' Do something here...
          End If
      Next
  </code></pre>
  
  <p>There are multiple chekcboxes on the user control. The code shown above is on the code behind page for the user control. </p>
  
  <p>(The user control is being used in conjunction with my CMS, Sitecore. I'm not sure if this has any effect on the problem I am experiencing or not.)</p>
  
  <p>Any suggestions?</p>