generated user controls

  • Thread starter pierre hourdille via .NET 247
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top