Click here to Skip to main content
13,346,713 members (68,706 online)
Rate this:
Please Sign up or sign in to vote.
Is there any specific harm or drawback if we use Session state in SharePoint 2010 ?

Actually we have a scenario in which we have to perceive the 100 rows (with seven column in each row) in a DataTable and perceive its values during the page refresh call that is being made on close of the SharePoint Modal Dialog box .

Actually we have to insert the rows to the datatable of parent page by opening a Modal Popup without submitting the data to the database .

Does storing the datatable with 100 rows in VIEWSTATE will be an alternate solution ,if Session state is not recommended ? Or we can go ahead with Session state ?
Posted 16-May-12 21:42pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Session is disabled by default in SharePoint. One reason is the memory usage may be invoked by thousands of users accessing the system. Although it can be enabled and set to use SQL Server, it isn't a recommended or common practice with SharePoint.

If the goal is to persist the data so it is available after closing the dialog there may be other alternatives. The client object model in SharePoint 2010 allows for asynchronous operations to refresh the data. The dialog framework also does not issue a postback when closing that I'm aware of.

SharePoint 2010 Client Object Model, Part 1[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I use ViewState all the time.

And it works good, PROVIDED that the SIZE of the data is "reasonably bounded" for the given network-access scenarios.

So the question is, "HOW BIG?" is the data when PERSISTED to the ViewState hidden field? If this is "too big" or not depends primarly upon network conditions; the ultimately issue with ViewState isn't that it must be downloaded, but rather that it must be sent BACK with each request - and connections are sometimes asymmetric in performance.

Just avoid using a DataTable as the default Serialization it uses works poorly with the serializer used in ASP.NET (which is quite efficient for primitive structure trees and collections that don't muck with a custom serialization).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180111.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100