Normal __Viewstate size?

calvineagle

New Member
I have made a small form (http://dev.basictheology.com/bible.aspx) but when you submit to it (just enter a verse) the __Viewstate of the form is huge (>7000 characters). Is that normal for .NET controlled forms?If EnableViewState is set to true (the default) for all your controls and you have something like a datagrid, the hidden viewstate field can get really large.<BR><BR>Try manually setting every control to EnableViewState="False" then take a look at it when you post. It should be only a line or two long.<BR><BR>You can then decide which controls really need to have viewstate enabled. As for the datagrid, it's likely a better strategy to put the underlying dataset into either the Cache<BR><BR> Cache.Add("TheName", TheSource)<BR><BR>then retrieve it and refresh the datagrid during the Page_Load event, or<BR><BR>put the dataset in a session variable and do the same thing.<BR><BR>Tom T<BR><BR>Thanks,<BR>I turned the grid's viewstate off and now it's much faster and the __viewstate is smaller.
 
Back
Top