473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Need more info on UserControls

Hello,

I'm writing UserControls as stated earlier. Now I come to the problem
that I need to preserve viewstate in my controls.

If I want to save the informations on the controls, in which event I
have to do so(on main form or on usercontrol)? Or could there be simplier
method such as writing a custom enableviewstate handler?

I've searched in google for tutorials on writing UserControls but much
of them do not cover these topics. Is there any more detailed tutorials
someone can suggest to me, so I need not keep asking questions here that
maybe too fundimential?

Thanks a lot.

Regards,
Lau Lei Cheong
Nov 18 '05 #1
2 1037
TJS
I too have searched for materials, books and tutorials on user controls and
found they are limited in availability or limited help.
I handle viewstate in my aspx files as user controls can be shared


"Lau Lei Cheong" <la****@yahoo.com.hk> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
Hello,

I'm writing UserControls as stated earlier. Now I come to the problem
that I need to preserve viewstate in my controls.

If I want to save the informations on the controls, in which event I
have to do so(on main form or on usercontrol)? Or could there be simplier
method such as writing a custom enableviewstate handler?

I've searched in google for tutorials on writing UserControls but much
of them do not cover these topics. Is there any more detailed tutorials
someone can suggest to me, so I need not keep asking questions here that
maybe too fundimential?

Thanks a lot.

Regards,
Lau Lei Cheong

Nov 18 '05 #2
The solution in my work now is to override LoadViewState and SaveViewState
methods.

In SaveViewState, I pack everything in the ViewState statebag then call
base.SaveViewState() to pass everything to _viewstate.

In LoadViewState, I pop everything after calling base.LoadViewState() to
restore the settings.

The above runs so far so good.

"TJS" <no****@here.com> ¦b¶l¥ó news:eX**************@TK2MSFTNGP12.phx.gbl ¤¤
¼¶¼g...
I too have searched for materials, books and tutorials on user controls and found they are limited in availability or limited help.
I handle viewstate in my aspx files as user controls can be shared


"Lau Lei Cheong" <la****@yahoo.com.hk> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
Hello,

I'm writing UserControls as stated earlier. Now I come to the problem that I need to preserve viewstate in my controls.

If I want to save the informations on the controls, in which event I
have to do so(on main form or on usercontrol)? Or could there be simplier method such as writing a custom enableviewstate handler?

I've searched in google for tutorials on writing UserControls but much of them do not cover these topics. Is there any more detailed tutorials
someone can suggest to me, so I need not keep asking questions here that
maybe too fundimential?

Thanks a lot.

Regards,
Lau Lei Cheong


Nov 18 '05 #3

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

Similar topics

1
by: Kate | last post by:
Hi: I have a picturebox control, and at runtime various usercontrols are added to it to make a diagram. As dynamically added usercontrols, they are of type VBExtender. Is there a way to save...
15
by: Tee | last post by:
Hi, I have a base usercontrol with a method (blank method, no code), I have another few usercontrols that will inherit this base usercontrol, but I want to force all the usercontrol that...
2
by: Emma | last post by:
Hi, I'm developing a GUI with almost all Usercontrols. It's been working wonderfull up till a few weeks ago, and really crashed yesterday. Suddenly I can no longer add some of my usercontrols...
3
by: YYZ | last post by:
I swear I've done my research, and now I was just hoping someone could explain this to me. I've got a base class (usercontrol) that I am using just as an interface. Meaning, I've defined...
3
by: b747_440 | last post by:
Dear Newsgroup, I'm an old VB6.0 developper who switched some time ago to VB.NET 2005. I really like that new Visual Studio. However, something is going wrong now and I can't figure out, what it...
1
by: keithb | last post by:
I have a command button in GridView row that fires the RowCommand Event when clicked. The event handler looks like this: protected void grid_RowCommand(Object sender, GridViewCommandEventArgs e)...
3
by: Nathan Sokalski | last post by:
I have my UserControls in a subdirectory called usercontrols. In the code for one of my UserControls I have the following: Public Property adimage() As String Get Return...
2
by: Robert Mago | last post by:
Hi, I have been using web usercontrols on 2003 for a very long time and i find them userful for modularity. Usually what i do is create a subfolder called 'UserControls' for example and placed...
4
by: Nathan Sokalski | last post by:
In several of my UserControls I add properties. If I access these properties in the CodeBehind of the pages that use the controls, I recieve an error when compiling. The reason for this is because...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.