Last post Feb 05, 2012 10:11 AM by Richey
Jan 30, 2012 09:56 AM|Rouchie|LINK
Apologies if this question has been asked a million times in the past; I've just realised the setting is within web.config and am now experimenting with it.
Suppose I set page viewstate to be stored in session rather than in-page:
<add key="ServerSideViewState" value="True" />
<add key="ViewStateStore" value="Session" />
This reduces my page size down by about 300%, which is great, however, can anyone answer the following:
Feb 01, 2012 03:27 AM|Qi Wu - MSFT|LINK
1.You may know you can use the In-Process or Out-of-Process session state. If you use the SQL Server mode the data will be stored in the database. We usually store some latest viewstate values for each user. When the user click the back button he could use
the values in viewstate.
2. When you store the viewstate in cache it will be kept in the memory. However, the data will be lost when you restart your computer. And the session is more flexible. You can store the viewstate in the SQL Server.
3. If you use session to store the viewstate it will consume the valuable server resources.
4. You may have large amount of data in the viewstate. Then the size of the page will be very high. If you store the viewstate out of the page you can decrease the client download time.
Feb 01, 2012 04:32 AM|Rouchie|LINK
Thank you for your reply.
Do you know any good reading material for informing us how to save ViewState data to SQL Server?
Feb 05, 2012 10:11 AM|Richey|LINK
In your scenery you can store your viewstate in session and use the session with SQL Server session state.