Grazie,
come al solito... però stavolta ho bisogno di un aiutino in più...
una delle operazioni che devo fare è aggiungere un handler ad una Sub della pagina.
Quindi ho nella pagina la Sub DataChanged a cui si deve aggiungere l'handler e nel modulo:
codice:
Public Shared Sub AddChangingEvent(ByVal Ogg As System.Web.UI.Page, ByVal AggiungiEvento As Boolean)
Dim Panel As Control
Dim Ctrl As Control
Dim C As CheckBox
Dim R As RadioButton
Dim T As TextBox
Dim D As DropDownList
For Each Panel In pannello.Controls
For Each Ctrl In Panel.Controls
If TypeOf Ctrl Is CheckBox Then
C = Ctrl
If AggiungiEvento Then AddHandler C.CheckedChanged, AddressOf Ogg.DataChanged Else RemoveHandler C.CheckedChanged, AddressOf Ogg.DataChanged
ElseIf TypeOf Ctrl Is RadioButton Then
R = Ctrl
If AggiungiEvento Then AddHandler R.CheckedChanged, AddressOf Ogg.DataChanged Else RemoveHandler R.CheckedChanged, AddressOf Ogg.DataChanged
ElseIf TypeOf Ctrl Is TextBox Then
T = Ctrl
If AggiungiEvento Then AddHandler T.TextChanged, AddressOf Ogg.DataChanged Else RemoveHandler T.TextChanged, AddressOf Ogg.DataChanged
ElseIf TypeOf Ctrl Is DropDownList Then
D = Ctrl
If AggiungiEvento Then AddHandler D.SelectedIndexChanged, AddressOf Ogg.DataChanged Else RemoveHandler D.SelectedIndexChanged, AddressOf Ogg.DataChanged
End If
Next
Next
End Sub
In questa sub devo quindi devo fare riferimento a Ogg.DataChanged e a Ogg.MainPanel ma come faccio?
Spero di esser stato chiaro...
ciao e grazie tanto assai!!!