S
shapper
Hello,
I am working on Library which will include various controls.
One of these controls has a TextBox.
I am using a property named Value to define the TextBox text:
' Value
Private _Value As String
Public Property Value() As String
Get
Return _Value
End Get
Set(ByVal value As String)
_Value = value
End Set
End Property ' Value
And the TextBox Init event is the following:
Private Sub tbText_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles tbText.Init
tbText.ID = "tbText"
tbText.Text = _Value
End Sub
I added this control to a page and defined its value to "Hello".
I also added a button to the page that when clicked basically does
Response.Write(MyControl.Value)
What happens is that when I change the TextBox text to "Goodbye" and
click the button the text that Response.Write outputs is "Hello".
Why isn't the property returning the new value?
What is the right way to do this?
Thanks,
Miguel
I am working on Library which will include various controls.
One of these controls has a TextBox.
I am using a property named Value to define the TextBox text:
' Value
Private _Value As String
Public Property Value() As String
Get
Return _Value
End Get
Set(ByVal value As String)
_Value = value
End Set
End Property ' Value
And the TextBox Init event is the following:
Private Sub tbText_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles tbText.Init
tbText.ID = "tbText"
tbText.Text = _Value
End Sub
I added this control to a page and defined its value to "Hello".
I also added a button to the page that when clicked basically does
Response.Write(MyControl.Value)
What happens is that when I change the TextBox text to "Goodbye" and
click the button the text that Response.Write outputs is "Hello".
Why isn't the property returning the new value?
What is the right way to do this?
Thanks,
Miguel