If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

System.Web.UI.WebControls + SqlServer Session State

I'm working on an application where a fair amount of data is being stored in the page's viewstate. As the project has progressed, the performance of the page really started to degrade. So, to correct the project, we started storing the page's viewstate in a session object on the server.

Unfortunately, when we started doing this we started getting the following error:

Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer'.

After looking at (and for) the error we are stumped! It seems that there is a web control that just won't serialize. However, if I'm reading the details of the error then it's one of Microsoft's own!

Another thought on this case,
we use View state normally to avoid going back to the database and handling event data across postbacks and other reasons,
Now when use session to store viewstate information I was kind of ok with it,

but then when you said you are using SQL Server Session State management to manage viewstate , you are basically going back to the database

In which case you might as well query your actual database and get more reliable up to data data? than sending viewstate to session in a SQL Server state implementation

I am not sure in the first place if you are using SQL Server State management or ASp.Net State Service, but seems like your web.config is set to one of these , if you didnt intend to use one of these I guess your session setting should say InProc ?