title: asp.net/VB.net: FindControl, instead of by ID by ControlType
body: <p>i need to find a control in a repeater in my asp.net application.</p>
  
  <p>At the moment I'm using <code>FindControl("IdOfControl")</code> and this is working well.</p>
  
  <p>But I need to find a control by its type (<code>ImageButton</code>).</p>
  
  <p>My current code:</p>
  
  <pre><code>For Each rptItem As RepeaterItem In myRepeater.Items
      Dim imgBtn As ImageButton = TryCast(rptItem.FindControl("myImageBtn"), ImageButton)
      AddHandler imgBtn.Click, AddressOf imgBtn_Click
  Next
  </code></pre>
  
  <p>I'm searching for something like that:</p>
  
  <pre><code>For Each rptItem As RepeaterItem In myRepeater.Items
      Dim imgBtn As ImageButton = TryCast(rptItem.FindControl(TypeOf ImageButton), ImageButton)
      AddHandler imgBtn.Click, AddressOf imgBtn_Click
  Next
  </code></pre>
  
  <p>Can anybody help?</p>