473,394 Members | 1,693 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,394 software developers and data experts.

CreateChildControls and View State

Hi,

I need to access view state data in my CreateChildControls method. Is there
anyway to achieve that?

I'm using ASP.NET 1.1.

Thanks.
Jun 6 '06 #1
2 2779
Michael wrote:
Hi,

I need to access view state data in my CreateChildControls method. Is
there anyway to achieve that?

I'm using ASP.NET 1.1.

Thanks.

Sure! use the ViewState object:
http://msdn.microsoft.com/library/en...gViewState.asp
http://msdn.microsoft.com/library/en...gViewState.asp
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jun 7 '06 #2
Hi Bob. Thanks for your reply. I'm creating a custom control (for SharePoint
Web Part). CreateChildControls() is being called before the view state is
loaded, so I can't access view state in CreateChildControls(). Anyway, I
changed my code, so that I now do whatever I wanted to do in
CreateChildControls() that needed view state in Load event instead.

Thanks.
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:et**************@TK2MSFTNGP02.phx.gbl...
Michael wrote:
Hi,

I need to access view state data in my CreateChildControls method. Is
there anyway to achieve that?

I'm using ASP.NET 1.1.

Thanks.

Sure! use the ViewState object:
http://msdn.microsoft.com/library/en...gViewState.asp
http://msdn.microsoft.com/library/en...gViewState.asp
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jun 7 '06 #3

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

Similar topics

6
by: Alex | last post by:
I believe that when you instantiate a Control derived custom control that implements the virtual method CreateChildControls(), that that base class constructor in Control calls...
3
by: Arulraja | last post by:
Hello, I have created 2 custom server controls, The parent custom control contains multiple child custom controls. The Child control has a button on it. If I Click the button control, it...
1
by: popman | last post by:
I develop a class which inherits textbox class.and I override the CreateChildControls method like code below: Protected Overrides Sub CreateChildControls() Controls.Add(New...
3
by: Philip Tripp | last post by:
I've read numerous sources stating that view state can be disabled per control, and per page, but can't seem to keep web form controls from remembering their state on a postback. I'm using VS.Net...
0
by: Ferret | last post by:
I've found what seems to be a nasty bug in the DataGrid and Repeater classes. If CreateChildControls gets called before LoadViewState, ViewState fails to map and you end up with nothing on a...
3
by: Iain | last post by:
In my custom control I have overriden CreateChildControls and the first few lines look like this. protected override void CreateChildControls() { Debug.WriteLine("CreateChildControls",...
1
by: Michael | last post by:
Hi, I'm coding a custom server control, and CreateChildControls() is giving me some pain. I'm just wondering why we have CreateChildControls(), and why this methods seems to be called at...
5
by: Mark Olbert | last post by:
Tonight's episode of me beating my head bloody against the monitor was the result of ViewState/ControlState information not being available when CreateChildControls() gets called for a...
1
by: xke | last post by:
I have a base class which overrides CreateChildControls / Render. Inside CreateChildControls, based on a public property ShowLinks in this class, I can include/display a usercontrol (kind of set of...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.