473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

minimizing viewstate

I have aspx pages with 10 checkboxlist controls. total individual checkbox
(the sum of individual checbox in those 10 checkboxlists) on the page is
about 1710. You can imagine how large the viewstate is. Is there anyway I
can shrink the viewstate and at the same time get the values of each
checkbox after postback?

Thanks
Apr 26 '06 #1
3 3008
On Wed, 26 Apr 2006 15:00:03 -0400, "Justin" <ju****@hotmail.com>
wrote:
I have aspx pages with 10 checkboxlist controls. total individual checkbox
(the sum of individual checbox in those 10 checkboxlists) on the page is
about 1710. You can imagine how large the viewstate is. Is there anyway I
can shrink the viewstate and at the same time get the values of each
checkbox after postback?

Thanks


On this same point is there anyway to disable saving the data of
controls that hold large amounts of data such as dropdownlists and
datagird but still allow them to store all the smaller values in
viewstate for things like which item index/row index was last
selected?

This would have the basic contract that you would be responsible for
repopulating the data during the init phase so that it is ready for
LoadSavedState.
Apr 27 '06 #2
CMM
You should ask this question in the aspnet groups, not here.... but
anyhow....

Not sure about the Checkboxlist.... but disabling ViewState does not prevent
you from getting a postback value from any control. In Page_Load
"reconstruct" your checkboxes.... the events fire next, and you will be able
to retrieve the Postbox "value."

I haven't experimented with Checkboxlist.... I know things with ViewState
can get a bit confusing.

--
-C. Moya
www.cmoya.com
"Chris Chilvers" <ke****@dynafus.com> wrote in message
news:72********************************@4ax.com...
On Wed, 26 Apr 2006 15:00:03 -0400, "Justin" <ju****@hotmail.com>
wrote:
I have aspx pages with 10 checkboxlist controls. total individual
checkbox
(the sum of individual checbox in those 10 checkboxlists) on the page is
about 1710. You can imagine how large the viewstate is. Is there anyway
I
can shrink the viewstate and at the same time get the values of each
checkbox after postback?

Thanks


On this same point is there anyway to disable saving the data of
controls that hold large amounts of data such as dropdownlists and
datagird but still allow them to store all the smaller values in
viewstate for things like which item index/row index was last
selected?

This would have the basic contract that you would be responsible for
repopulating the data during the init phase so that it is ready for
LoadSavedState.

Apr 27 '06 #3
CMM
Also
On this same point is there anyway to disable saving the data of
controls that hold large amounts of data such as dropdownlists and
datagird but still allow them to store all the smaller values in
viewstate for things like which item index/row index was last
selected?

Yeah. Disable ViewState for the control, and add your own values to
ViewState manually (ViewState("myvalue") = Somecontrol.SomeValue) and reset
the property in question of the control on Postbacks in Page_Load.

In fact, try completely disabling the ViewState for the Checkboxlist control
and see if you lose anything. I'll be you don't. If you're adding items
manually in Page_Load rather than in the designer simply remove the If
Me.IsPostBack and "reconstruct" the items on every postback. This works
beautifully and everything works!

Note you do not have to "reconstruct" the items in your Checkboxlist in
Page_Load if you define the items in the ASP markup (in the designer). Only
if you create the Checkboxlist.Items manually in code (in the Page_Load
event for instance).

Basically, ViewState allows you to make changes to your controls in the
Code-Behind and have those changes saved on subsequent postbacks.

--
-C. Moya
www.cmoya.com
"CMM" <cm*@nospam.com> wrote in message
news:eR**************@TK2MSFTNGP05.phx.gbl... You should ask this question in the aspnet groups, not here.... but
anyhow....

Not sure about the Checkboxlist.... but disabling ViewState does not
prevent you from getting a postback value from any control. In Page_Load
"reconstruct" your checkboxes.... the events fire next, and you will be
able to retrieve the Postbox "value."

I haven't experimented with Checkboxlist.... I know things with ViewState
can get a bit confusing.

--
-C. Moya
www.cmoya.com
"Chris Chilvers" <ke****@dynafus.com> wrote in message
news:72********************************@4ax.com...
On Wed, 26 Apr 2006 15:00:03 -0400, "Justin" <ju****@hotmail.com>
wrote:
I have aspx pages with 10 checkboxlist controls. total individual
checkbox
(the sum of individual checbox in those 10 checkboxlists) on the page is
about 1710. You can imagine how large the viewstate is. Is there anyway
I
can shrink the viewstate and at the same time get the values of each
checkbox after postback?

Thanks


On this same point is there anyway to disable saving the data of
controls that hold large amounts of data such as dropdownlists and
datagird but still allow them to store all the smaller values in
viewstate for things like which item index/row index was last
selected?

This would have the basic contract that you would be responsible for
repopulating the data during the init phase so that it is ready for
LoadSavedState.


Apr 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
3
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
10
by: neo | last post by:
hi, I am studying ASP.NET and have few questions - 1) The session ID and values of controls is stored in VIEWSTATE variable. So now when we put EnableViewState="false" in Page directive and...
7
by: et | last post by:
I'm not sure I understand the use of the ViewState. Do I understand correctly that values of controls are automatically held in a hidden control called ViewState? If so, then why can't we get...
9
by: Mark Broadbent | last post by:
Been a while since I've touched asp.net but one thing that always seems to fustrate me is the loss of state on variable declarations. Is there anyway (i.e. assigning an attribute etc) to instruct...
6
by: hitendra15 | last post by:
Hi I have created web user control which has Repeater control and Linkbutton in ItemTemplate of repeater control, following is the code for this control On first load it runs fine but when...
7
by: Lee | last post by:
Hi, How do I detect when a form is minimizing? specifically when a user clicks the show desktop button on the taskbar, rather than the minimize button on a form. thanks in advance
12
by: Nick C | last post by:
Hi How can i reduce the viewstate for my asp.net application. It is getting very large now. What is a good solution? thanks N
3
by: qazplm114477 | last post by:
Hi, I'm having a tiny problem. I have just started playing around with visual basic a week ago so im fairly new at this. I created a method that saves changes when you click a button, once the button...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.