By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,247 Members | 871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,247 IT Pros & Developers. It's quick & easy.

too logn viewstate

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Guogi try reading :-
http://msdn.microsoft.com/msdnmag/is...ETPerformance/
It should give you an idea how you can achieve it


*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #2

P: n/a

"guoqi zheng" <no@sorry.com> wrote in message
news:12******************************@ureader.com. ..
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

Nov 19 '05 #3

P: n/a
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
Nov 19 '05 #4

P: n/a

"guoqi zheng" <no@sorry.com> wrote in message
news:cd******************************@ureader.com. ..
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
Nov 19 '05 #5

P: n/a

"vMike" <Mi************@spamnotgewarren.com.delete> wrote in message
news:u0*****************@newsread2.news.atl.earthl ink.net...

"guoqi zheng" <no@sorry.com> wrote in message
news:cd******************************@ureader.com. ..
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

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.
Nov 19 '05 #6

P: n/a
I think you are right. Indeed, it works now. Thanks

regards,

Guoqi Zheng
http://www.ureader.com
Nov 19 '05 #7

P: n/a
guoqi zheng wrote:
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?

Nov 19 '05 #8

P: n/a
vMike wrote:
"vMike" <Mi************@spamnotgewarren.com.delete> wrote in message
news:u0*****************@newsread2.news.atl.earthl ink.net...

"guoqi zheng" <no@sorry.com> wrote in message
news:cd******************************@ureader.com. ..
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

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.

Nov 19 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.