disable viewstate of dynamically created checkboxes

Discussion in 'ASP .Net Building Controls' started by Anton Sommer, Sep 29, 2003.

  1. Anton Sommer

    Anton Sommer Guest

    Hello folks,

    in a usercontrol I create a table dynamically, and that table contains a lot
    of chekboxes. I have set enable viewstate property to false for the
    usercontrol, the table, alle table row, all table cells and all checkboxes
    but still the viewstate for the checkboxes is kept. Although I don't need
    it. When creating the table just without the checkboxes the viewstate is
    small but with them chekboxes it is huge but I don't want it to be there.
    What can I do?


    thank you

    Anton
    Anton Sommer, Sep 29, 2003
    #1
    1. Advertising

  2. Anton Sommer

    Teemu Keiski Guest

    Hi,

    the CheckBox for being checked is not related to ViewState, but to feature
    of certain controls that post their data back to the server. These controls
    implement IPostBackDataHandler interface.

    You can clear CheckBoxes in PreRender phase of the Page.

    --
    Teemu Keiski
    MCP, ASP.NET MVP
    AspInsiders Member, www.aspinsiders.com
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com


    "Anton Sommer" <> wrote in message
    news:bl82lh$ero$06$-online.com...
    > Hello folks,
    >
    > in a usercontrol I create a table dynamically, and that table contains a

    lot
    > of chekboxes. I have set enable viewstate property to false for the
    > usercontrol, the table, alle table row, all table cells and all checkboxes
    > but still the viewstate for the checkboxes is kept. Although I don't need
    > it. When creating the table just without the checkboxes the viewstate is
    > small but with them chekboxes it is huge but I don't want it to be there.
    > What can I do?
    >
    >
    > thank you
    >
    > Anton
    >
    >
    Teemu Keiski, Oct 5, 2003
    #2
    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. John Crowley
    Replies:
    0
    Views:
    723
    John Crowley
    Jan 14, 2004
  2. yufufi
    Replies:
    2
    Views:
    383
    Teemu Keiski
    Jul 7, 2004
  3. Steve Harclerode
    Replies:
    6
    Views:
    503
    Steve Harclerode
    Jun 25, 2009
  4. msimmons
    Replies:
    0
    Views:
    470
    msimmons
    Jul 16, 2009
  5. LRW
    Replies:
    6
    Views:
    157
Loading...

Share This Page