P
pierre hourdille via .NET 247
Hi,
I have a problem generating user controls at runtime:
I declare in my aspx page :
Dim userGrp As groups = New groups
phUsers.Controls.Add(userGrp)
userGrp.inicializar(sGrupo)
---------------------------------
... where phUsers is a placeHoder.
in my user control I have a "inicializar" public function :
Public Sub inicializar(ByVal grupo As String)
lblTitulo.Text = grupo
End Sub
------------------------------------------
and this html code:
<asp:Label ID="lblTitulo" CssClass="titulo" Runat="server"></asp:Label>
when I try to acces to lblTituloUsers.text (a label declared as protected withevents in my user control)
I have a "Reference to object ... " bug.
How can I acces the controls in my user control ?
Thank you for a little help
Pierre
I have a problem generating user controls at runtime:
I declare in my aspx page :
Dim userGrp As groups = New groups
phUsers.Controls.Add(userGrp)
userGrp.inicializar(sGrupo)
---------------------------------
... where phUsers is a placeHoder.
in my user control I have a "inicializar" public function :
Public Sub inicializar(ByVal grupo As String)
lblTitulo.Text = grupo
End Sub
------------------------------------------
and this html code:
<asp:Label ID="lblTitulo" CssClass="titulo" Runat="server"></asp:Label>
when I try to acces to lblTituloUsers.text (a label declared as protected withevents in my user control)
I have a "Reference to object ... " bug.
How can I acces the controls in my user control ?
Thank you for a little help
Pierre