LoadViewState is not called

M

Memi Lavi

Hi Guys.

I have a very strange problem.

I've developed a simple web control, which inherits directly from the
webcontrol class.
I've overriden the LoadViewState and SaveViewState methods, in order
to customize the control's viewstate.
Problem is, while the SaveViewState method is always called, the
LoadViewState is never called, even when the page is posted back.

The control was NOT added dynamically to the form. It was added at
design time using the VS.NET designer.

Please Help!
 
A

Alessandro Zifiglio

hi Memi,
Your giving very little to work on, actually some sample code of what you
are doing would be nice, however from what you have mentioned, You never
said anything about overriding TrackViewstate which is also needed. Override
this too. You then need to have calls to trackViewState in every individual
property you are exposing and for Items whom you want added into viewstate
and restored.
 

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,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top