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
 

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

Enum Problem 1
Control Problem 1
Property 1
Adding property to class 0
Own aspNet control - tag contents as default property 2
Custom WebControl with OnClick event 3
Property 1
Property is empty. Why? 2

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top