Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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[^]
 
Share this answer
 
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).
 
Share this answer
 
v6

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900