By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,357 Members | 982 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,357 IT Pros & Developers. It's quick & easy.

viewstate and postback problem (If there is no property, no controls)

P: 1
Ok, first of all, forgiveness for my English.

I understand the sequence of events within a control. However, I have a problem when dynamically generates controles.

The Control, loads a collection of items. For each item, there will be a control child. The collection within reside in a property. But what happens if the event "createchildcontrols" happening before my property can be loaded into the viewstate. "If there is no property, no controls"!

The quick solution I found was to re-call the method "createchildcontrols" in the render method. Before rendering, earned my controls have been created. Therefore, the event happens twice.

Another problem is when storing values directly into the viewstate. I don't understand why loading the viewstate after the second postback. Ie, the first postback can not access (from any method) the stored value. However, if at this time I try to store in viewstate, from the second time in the future, I can access this value.

I hope that you have not confused ... I hope someone will help me, I spent weeks trying to fix it
Nov 27 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.