Cannot serialize Object to ViewState only Session

来源:互联网 发布:java词汇大全 编辑:程序博客网 时间:2024/05/19 22:26

http://stackoverflow.com/questions/925553/cannot-serialize-object-to-viewstate-only-session

The reason is that view state serialization is done by the LosFormatter class while session serialization is done by the BinaryFormatter class. The two are subtly different and one of these subtle differences is probably causing your problem.

Take a look at this article and the documentation for LosFormatter to see if you can find some clues about what is causing your problem.


http://msdn.microsoft.com/en-us/library/bb738446.aspx

Because entity types support binary serialization, objects can be saved in the view state of an ASP.NET application during a postback operation. When required, the object and its related objects are retrieved from the view state and attached to an existing object context.

原创粉丝点击