How to store custom objects in a View state using VB.NET

Software developer can store custom objects in a view state just as easily as regular types. However, to store an item in a view state, ASP.NET must be able to convert it into a stream of bytes. This process is called serialization. If developer’s objects aren’t serializable, he will receive an error message when he attempts to place them in a view state.

To make his objects serializable, the software developer need to add [Serializable] attribute before his class declaration: