Dim Cta As Control, Ctb As Control, Ctc As Control, Ctd As Control, Cte As Control
Dim strTipo As String
For Each Cta In xPage.Form.Controls 'recorre page
For Each Ctb In Cta.Controls 'recorre forms
strTipo = Ctb.GetType.ToString
If TypeOf Ctb Is TextBox Then
CType(Ctb, TextBox).Text = Idi(CType(Ctb, TextBox).Text)
ElseIf TypeOf Ctb Is Label Then
CType(Ctb, Label).Text = Idi(CType(Ctb, Label).Text)
ElseIf TypeOf Ctb Is Button Then
CType(Ctb, Button).Text = Idi(CType(Ctb, Button).Text)
ElseIf strTipo = "System.Web.UI.UpdatePanel" Then 'recorre updatepanel
For Each Ctc In Ctb.Controls
strTipo = Ctc.GetType.ToString
If TypeOf Ctc Is TextBox Then
CType(Ctc, TextBox).Text = Idi(CType(Ctc, TextBox).Text)
ElseIf TypeOf Ctc Is Label Then
CType(Ctc, Label).Text = Idi(CType(Ctc, Label).Text)
ElseIf TypeOf Ctc Is Button Then
CType(Ctc, Button).Text = Idi(CType(Ctc, Button).Text)
End If
For Each Ctd In Ctc.Controls 'recorre otros
strTipo = Ctd.GetType.ToString
If TypeOf Ctd Is TextBox Then
CType(Ctd, TextBox).Text = Idi(CType(Ctd, TextBox).Text)
End If
If TypeOf Ctd Is Label Then
CType(Ctd, Label).Text = Idi(CType(Ctd, Label).Text)
End If
If TypeOf Ctd Is Button Then
CType(Ctd, Button).Text = Idi(CType(Ctd, Button).Text)
End If
If TypeOf Ctd Is Panel Then 'button
For Each Cte In Ctd.Controls
strTipo = Cte.GetType.ToString
If TypeOf Cte Is TextBox Then
CType(Cte, TextBox).Text = Idi(CType(Cte, TextBox).Text)
End If
If TypeOf Cte Is Label Then
CType(Cte, Label).Text = Idi(CType(Cte, Label).Text)
End If
If TypeOf Cte Is Button Then
CType(Cte, Button).Text = Idi(CType(Cte, Button).Text)
End If
Next
End If
Next
Next
End If
Next
Next