Error description:
Unable to serialize session status. In "StateServer" or "sqlserver" mode, ASP. NET serializes session State objects and therefore does not allow the use of non-serializable objects or externalbyref objects. If a custom session state is stored in custom mode and similar serialization is performed, the same restrictions apply.
Problem description:
I used the struct schema, Bill, and put multiple struct-type bills into an array variable of the arraylist type. I tried to assign the array value to the session and read the session on another page, system Error !!!
Solution:
After finding the problem online, I came to the conclusion that the variables I defined cannot be serialized, so I tried to add [serializable] to Bill. For example:
[Serializable]
Public struct Bill
{
Public string name;
Public String unit;
Public String count;
}
Solve the problem !!!