Alright, as much as I try to avoid using FindControl() sometimes I need to get a control by its ID. I came across what seems like a good idea here :
549 Private Sub BuildControlHashTable()
550 Dim cName As String = String.Empty
551 For i As Int16 = 0 To Me.Controls.Count - 1
552 cName = Me.Controls(i).ID
553 If Not (cName Is Nothing) Then
554 cntrlHashTbl.Add(cName, Me.Controls(i))
555 End If
556 Next
557 End Sub
558 Private Function GetControlByName(ByVal cntrlName As String) As Control
559 Return CType(Me.cntrlHashTbl(cntrlName), Control)
560 End Function
Good idea? Bad idea? Thoughts?