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. Advertising

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. Tom
    Replies:
    0
    Views:
    3,825
  2. Steph
    Replies:
    2
    Views:
    1,670
    heislord5
    May 11, 2011
  3. ALI-R

    ASP.Net Framework2 and webparts

    ALI-R, Mar 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    391
    Brock Allen
    Mar 16, 2005
  4. =?Utf-8?B?U2hlbGw=?=

    How to give 3d Look to Datagrid and WebParts control?

    =?Utf-8?B?U2hlbGw=?=, Oct 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    564
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Oct 28, 2005
  5. =?Utf-8?B?SmF2?=

    Do MasterPages and WebParts not mix!

    =?Utf-8?B?SmF2?=, Jun 12, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    346
    =?Utf-8?B?SmF2?=
    Jun 12, 2006
Loading...

Share This Page