This is a migrated thread and some comments may be shown as answers.

Huge ViewState after upgrading Telerik ORM

1 Answer 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Craig A
Top achievements
Rank 1
Craig A asked on 16 Aug 2011, 09:38 PM
We recently upgraded our Telerik.Web.UI.DLL and OpenAccess ORM to the latest versions and found that our ViewState for each page jumped significantly - example from 8KB to 200KB. This was across the board on almost all our pages.

After much digging around we found that this was being caused by the StoreOriginalValuesInViewState property of the OpenAccessDataSource object, which defaults to true if not set. I could not find anything in the forums or the Support site about this issue, so I thought this might help somebody else that runs into this. Setting this value to false for each data source allowed our viewstate to go back to normal.

1 Answer, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 19 Aug 2011, 01:52 PM
Hello Craig,

You are correct that leaving the StoreOriginalValuesInViewState set to True can significantly increase the size of your ViewState. It stores all the original values of the changed objects for the purpose of managing concurrency when the changes are applied in the database.

There are two approaches for that issue:

1) If you access the data in mostly read-only mode or you just don’t care too much about concurrency for other reasons, you can set the property to False. This means that the original values will not be stored and when changes are applied there will be no guarantee that the row hasn’t changed in the meantime.

2) You can implement paging of the OpenAccessDataSource by setting the AutoPage property to True. That should decrease the ViewState size.

Do not hesitate to contact us if you need further assistance.



Greetings,
Ivailo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
Craig A
Top achievements
Rank 1
Answers by
Ivailo
Telerik team
Share this question
or