Webparts and ViewState

Discussion in 'ASP .Net' started by =?Utf-8?B?QXN0ZXJh?=, Jun 7, 2005.

  1. 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.
     
    =?Utf-8?B?QXN0ZXJh?=, Jun 7, 2005
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Rush
    Replies:
    2
    Views:
    799
    Ben Rush
    Dec 5, 2003
  2. Tom
    Replies:
    0
    Views:
    4,004
  3. Steph
    Replies:
    2
    Views:
    1,904
    heislord5
    May 11, 2011
  4. ujjc001
    Replies:
    0
    Views:
    1,575
    ujjc001
    Jul 27, 2005
  5. sck10
    Replies:
    6
    Views:
    1,270
    sck10
    Sep 1, 2006
  6. mark

    Viewstate errors... how do I get viewstate working?

    mark, Feb 20, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    451
  7. Josema
    Replies:
    2
    Views:
    605
  8. Josema
    Replies:
    0
    Views:
    368
    Josema
    May 9, 2005
Loading...