Use property in custom control


S

shapper

Hello,

I am creating a custom control and I have the following property:
<Bindable(True), Category("Appearance"), DefaultValue(""),
Localizable(True)> Property Text() As String
Get
Dim s As String = CStr(ViewState("Text"))
If s Is Nothing Then
Return String.Empty
Else
Return s
End If
End Get

Set(ByVal Value As String)
ViewState("Text") = Value
End Set

End Property

I created a ChildControl as follows:
Protected Overrides Sub CreateChildControls()

' Create child controls
Dim lMessage As New Label

' Define lMessage properties
With lMessage
.Text = ???????????????????
.ID = "lMessage"
End With

End Sub
----------------------------

How do I set lMessage.Text = Text property value?

Thanks,
Miguel
 
Ad

Advertisements


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

Similar Threads


Top