473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help me to clarify User control

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
Nov 19 '05 #1
1 1090
problem resolved

"serge calderara" wrote:
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2691
by: brendan | last post by:
Sorry this isnt a cross post .. i just didnt get any help from alt.php. I have a website which utilises post forms for navigation in some areas. Problem is, when *some* users hit the BACK button...
20
2635
by: titi | last post by:
Question The road and traffic authority for a small country currently uses a system to store information about all 'currently' licensed drivers. A licensed driver has the following info stored...
13
3577
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any...
2
1394
by: Cider123 | last post by:
Trying to figure out how to replicate the same interface as what a ListView control has. I have everything working for the most part, with exception of 1 minor setback. I can't seem to pass...
2
1234
by: Lau Lei Cheong | last post by:
Hello, I'm writing a usercontrol that contains a property named "disabled". It is set to false by default but there is also another button in the usercontrol that'll set it to true. On the...
3
2222
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
1638
by: arthernan | last post by:
I have an almost finished page that uses webparts. And this is the expected functionality. A logged on user hits a button and the button opens a WebPart. Then the user logs off, next time he logs...
6
2659
by: junk | last post by:
Senerio: I have a custom user control which contains two control arrays. The user control has a group box in which the two control arrays are dynamically built. The two control arrays are...
0
2832
by: sunny152 | last post by:
Hello Friends, I'm very interested to broadcast our church worship service live on internet.My web server having streaming feature and i have windows media encoder program.I usually...
0
7324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7042
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5052
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.