S
shapper
Hello,
I am creating a Composite Control, named Form, which contains a
TextBox.
Form control has a property named Value which define the TextBox text
property.
When I define it as follows it does not work:
Public Property Value() As String
Get
Return ViewState("Value")
End Get
Set(ByVal value As String)
ViewState("Value") = value
End Set
End Property ' Value
Private Sub tbInput_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles tbInput.Init
tbInput.Text = Me.Value
End Sub ' tbInput_Init
Then I changed this simply to:
Public Property Value() As String
Get
Return tbInput.Text
End Get
Set(ByVal value As String)
tbInput.Text = value
End Set
End Property ' Value
Aren't both approaches the same?
Thanks,
Miguel
I am creating a Composite Control, named Form, which contains a
TextBox.
Form control has a property named Value which define the TextBox text
property.
When I define it as follows it does not work:
Public Property Value() As String
Get
Return ViewState("Value")
End Get
Set(ByVal value As String)
ViewState("Value") = value
End Set
End Property ' Value
Private Sub tbInput_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles tbInput.Init
tbInput.Text = Me.Value
End Sub ' tbInput_Init
Then I changed this simply to:
Public Property Value() As String
Get
Return tbInput.Text
End Get
Set(ByVal value As String)
tbInput.Text = value
End Set
End Property ' Value
Aren't both approaches the same?
Thanks,
Miguel