This is because the page label doesn't get initialised. You can do:
VB Code:
Public Function SetFooter(ByVal f As String)
lblFooterName = New System.Web.UI.WebControls.Label
Me.lblFooterName.Text = f
End Function
But thats just wrong.
You are going about this the wrong way.
What you need to do is this. In the usercontrol have:
VB Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Public Property FooterText() As String
Get
Return Me.lblFooterName.Text
End Get
Set(ByVal Value As String)
Me.lblFooterName.Text = Value
End Set
End Property
Then on your web page:
Code:
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<uc1:Footer id="Footer1" FooterText="Moooooooooose" runat="server"></uc1:Footer>
</form>
</body>
Does that make sense?
Woof