disable viewstate of dynamically created checkboxes

A

Anton Sommer

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
 
T

Teemu Keiski

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
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top