Webparts and ViewState

G

Guest

I seem to be having a problem or am just not understanding something with
WebParts. I am losing ViewState when I add a control to a ZoneTemplate. For
example, if I have a Label and set the Label's Text property to "bar" only on
the first page load(i.e. !IsPostBack), and then click a button or something,
it works fine. Viewstate has retained the value "bar". However, when I add
the Label to a WebPartZone and repeat the same experiment, I lose the value
"bar". I have tried the same experiment with a GridView (about 50 rows with
5 columns of data) and the page size differs by about 2K by either placing
the grid inside or outside (outside being larger) the WebPartZone. The
strange thing with the GridView experiment is that it kept all of the rows
and columns, but the cell data was gone! This, to me, looks like the
GridView's ViewState was maintained, but not its child controls. What is
going on here?
Thank you in advance.
 

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

Similar Threads


Members online

Forum statistics

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

Latest Threads

Top