LoadViewState does not fire on a postback event

J

Jean Erasmus

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
 
V

Victor Garcia Aprea

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
 
J

Jean Erasmus

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top