Grazie del contributo ma non funziona..
forse c'è una mancanza nel controllo utente o nel codice aspx.
ma richide un RaiseEvent che nonostante le documentazioni in rete non riesco ad implementarlo.
codice:
DirectCast(UserCtrl.BottoneModifica, Button).Click = _
AddHandler btnModifica.Click, AddressOf btnModifica_Click
user control code:
codice:
Partial Public Class _Controls_Botton
Inherits System.Web.UI.UserControl
Public Property BottoneSalva() As IButtonControl
Get
Return btnSalva
End Get
Private Set(ByVal value As IButtonControl)
End Set
End Property
Public Property BottoneElimina() As IButtonControl
Get
Return btnElimina
End Get
Private Set(ByVal value As IButtonControl)
End Set
End Property
Public Property BottoneModifica() As IButtonControl
Get
Return btnModifica
End Get
Private Set(ByVal value As IButtonControl)
End Set
End Property
End Class
ASP CODE:
codice:
Partial Class test1
Inherits PageBase
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
'parte che genera errore
'-------------------------------------
DirectCast(UserCtrl.BottoneModifica, Button).Click = _
AddHandler btnModifica.Click, AddressOf btnModifica_Click
'-------------------------------------------------------
DirectCast(UserCtrl.BottoneModifica, Button).Enabled = False
DirectCast(UserCtrl.BottoneSalva, Button).Visible = False
End Sub
Private Sub btnModifica_Click(ByVal sender As Object, ByVal e As EventArgs)
Throw New NotImplementedException()
End Sub