Groups | Blog | Home
all groups > asp.net building controls > november 2003 >

asp.net building controls : LoadViewState does not fire on a postback event


Jean Erasmus
11/25/2003 1:06:44 PM
Hi there,

I need some help please. I have created a composite control that have a
collection of items associated with it. Now I want to save this to the view
state of the control, but the LoadViewState method does not get called so I
can get the collection out of the view state.

Does anybody have any idee why this is happening?

Regards,
Jean

Victor Garcia Aprea
11/26/2003 1:35:55 AM
Hi Jean,

A very common cause for viewstate to not be loaded it late addition to the
control tree. Is your composite being added dynamically or is it declared at
design-time? What about its childrens?

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
[quoted text, click to view]

Jean Erasmus
11/28/2003 10:04:01 AM
Hi Victor,

I found the problem. I was using an inherited page class, and the control
was being loaded before the base.OnInit was called.

Regards,

Jean

[quoted text, click to view]

AddThis Social Bookmark Button