Calendar problem - fail to load view state

  • Thread starter Fernando A. Gómez F.
  • Start date
F

Fernando A. Gómez F.

Hello all.

I'm building a WebPart. In the CreateChildControls override, the webpart
creates a Calendar control in the following way:

_productCaducityDateCalendar = new Calendar();
_productCaducityDateCalendar.ID = "_productCaducityCalendar";
Controls.Add(_productCaducityDateCalendar);

However, when a postback is generated, it throws an exception with a
"fail to load viewstate" message.

I've been googling and this behaviour seems to happen whenever the
control's ID changes in a postback. However, the creation logic is
simple and I already ensured that the ID is the same.

Does anybody have an idea on what I'm doing wrong here? Any clue will be
really appreciated.

Best regards.
 

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

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top