G
Guest
Dear all,
I have created a simple user control (server Button) with a public property
define has follow:
Public Property value() As Integer
Get
'return value
Return ViewState("Value")
End Get
Set(ByVal Value As Integer)
ViewState("Value") = Value
End Set
End Property
When user will click on that button it will simply increment the value
Then I drop that user control on a webform, then add to the webform a
textbox that will contain the user control incremented value.
As I ma studying for my asp.net exam, there is one sample in MS press book
saying that in order to retrive the initial text value from the user control,
you need to place following line under the Weform Page_PreRender event, this
because the control is not executed until its container is not fully loaded.
So in that event I add following code :
TextBox1.Text = Spin.value
Note that Spin is declared as follow :
Protected WithEvents Spin As WebUserControl1
Runing that simple sample return an error of time object not defined
Then I set a break point in the Pre_Render event and I can noticed that the
Spin object is set to Nothing
What dis I miss here ?
Does this pre_render is a wrong information ?
thnaks for your help
regards
I have created a simple user control (server Button) with a public property
define has follow:
Public Property value() As Integer
Get
'return value
Return ViewState("Value")
End Get
Set(ByVal Value As Integer)
ViewState("Value") = Value
End Set
End Property
When user will click on that button it will simply increment the value
Then I drop that user control on a webform, then add to the webform a
textbox that will contain the user control incremented value.
As I ma studying for my asp.net exam, there is one sample in MS press book
saying that in order to retrive the initial text value from the user control,
you need to place following line under the Weform Page_PreRender event, this
because the control is not executed until its container is not fully loaded.
So in that event I add following code :
TextBox1.Text = Spin.value
Note that Spin is declared as follow :
Protected WithEvents Spin As WebUserControl1
Runing that simple sample return an error of time object not defined
Then I set a break point in the Pre_Render event and I can noticed that the
Spin object is set to Nothing
What dis I miss here ?
Does this pre_render is a wrong information ?
thnaks for your help
regards