Z
Z D
Hello,
I thought that viewstate is inherintly serializable because its stored in a
users browser in text (serialized) format??
Anyways - Here's the situation: I have some pages that have many grids on it
and thus my viewstate was getting very large (75kb+) and it was slowing down
the page loads for the end user.
SO - I decided to store the viewstate in session (on the server) instead of
having it written out to the browser. This GREATLY increased performance
and things were just fine!
Then I decided to have the session stored in a state server instead of
InProc on the same web server because eventually I'd want to add an
additional load-balanced webserver.
This is when the trouble began, now, I get the following error on the pages
that I try to save the viewstate to seesion. Note: All other session
varibles seem to work, except when trying to save viewstate to session. I've
posted the error and the relavent code below, pelase help!!
THE 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'.
THE CODE:
=========
'Save Viewstate in session.
Protected Overrides Sub SavePageStateToPersistenceMedium(ByVal viewState As
Object)
Me.Session.Add("PageViewState", viewState)
End Sub
'Retreive viewstate from session
Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object
Return Me.Session("PageViewState")
End Function
If anybody can tell me how this error makes sense and how to avoid it I
would appreciate it very much. I dont understand why its complaining about
viewstate not being serializable because I thought that was implicit since
it's stored in the users browser!
thanks in advance for any help,
-ZD
I thought that viewstate is inherintly serializable because its stored in a
users browser in text (serialized) format??
Anyways - Here's the situation: I have some pages that have many grids on it
and thus my viewstate was getting very large (75kb+) and it was slowing down
the page loads for the end user.
SO - I decided to store the viewstate in session (on the server) instead of
having it written out to the browser. This GREATLY increased performance
and things were just fine!
Then I decided to have the session stored in a state server instead of
InProc on the same web server because eventually I'd want to add an
additional load-balanced webserver.
This is when the trouble began, now, I get the following error on the pages
that I try to save the viewstate to seesion. Note: All other session
varibles seem to work, except when trying to save viewstate to session. I've
posted the error and the relavent code below, pelase help!!
THE 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'.
THE CODE:
=========
'Save Viewstate in session.
Protected Overrides Sub SavePageStateToPersistenceMedium(ByVal viewState As
Object)
Me.Session.Add("PageViewState", viewState)
End Sub
'Retreive viewstate from session
Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object
Return Me.Session("PageViewState")
End Function
If anybody can tell me how this error makes sense and how to avoid it I
would appreciate it very much. I dont understand why its complaining about
viewstate not being serializable because I thought that was implicit since
it's stored in the users browser!
thanks in advance for any help,
-ZD