too logn viewstate

G

guoqi zheng

Viewstate is nice, but you know viewstate data counts 1/3 of my page size.

I need viewstate because I have button control inside my repeater control,
but any idea how can I reduce the viewstate site, it sounds horrible to have
so big viewstate.

regards,

Guoqi Zheng
http://www.ureader.com
 
V

vMike

guoqi zheng said:
Viewstate is nice, but you know viewstate data counts 1/3 of my page size.

I need viewstate because I have button control inside my repeater control,
but any idea how can I reduce the viewstate site, it sounds horrible to have
so big viewstate.

regards,

Guoqi Zheng
http://www.ureader.com

It took a bit of extra coding, but I found the you can turn the viewstate
off for many lower level controls and then put your own items in viewstate
that you need to remember on post back. The key is figuring out exactly what
you need on postback and what you do not need. I was able to take my
viewstate from 18K down to 2K of page weight.

Mike
 
G

guoqi zheng

ja, right,

I put EnableViewState = false on many controls. But it is a repeater control
and data on repeater control has to be remembered, that is big. that is the
problem.

The situation is that I have a repeater control, inside that control, I have
one button control. When user clicks that button control, server has to do
something based the datarow of that repeater. Do you think I can disable
viewstate on that repeater control???

regards,

Guoqi Zheng
http://www.ureader.com
 
V

vMike

guoqi zheng said:
ja, right,

I put EnableViewState = false on many controls. But it is a repeater control
and data on repeater control has to be remembered, that is big. that is the
problem.

The situation is that I have a repeater control, inside that control, I have
one button control. When user clicks that button control, server has to do
something based the datarow of that repeater. Do you think I can disable
viewstate on that repeater control???

regards,

Guoqi Zheng
http://www.ureader.com

I have enableviewstate=false on datalists ( I have not tried this on
repeaters, but I think it would work). The trick you must bind the data
source of the datalist during the page_load event. I don't know the techical
reason, but by doing this the events such as onclick are restored. Hope
this helps.

Mike
 
V

vMike

vMike said:
I have enableviewstate=false on datalists ( I have not tried this on
repeaters, but I think it would work). The trick you must bind the data
source of the datalist during the page_load event. I don't know the techical
reason, but by doing this the events such as onclick are restored. Hope
this helps.

Mike
This should say, you must rebind the datalist (or repeater) during the
page_load event even on postback.

So by eliminating the viewstate you increase the backend processing a bit.
 
A

Aquila Deus

guoqi said:
Viewstate is nice, but you know viewstate data counts 1/3 of my page
size.

It could count more than 90% if you use large datagrids
I need viewstate because I have button control inside my repeater control,
but any idea how can I reduce the viewstate site, it sounds horrible to have
so big viewstate.

Eh.. What exactly do you need the viewstate for?? Could you paste a few
lines of your .aspx?
 
A

Aquila Deus

vMike said:
has to
do
This should say, you must rebind the datalist (or repeater) during the
page_load event even on postback.

So by eliminating the viewstate you increase the backend processing a
bit.

If the datalist/repeater is not user-specific, Cache should be a better
solution to improve the performance.
 

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

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top