Search code examples
c#asp.netclassviewstate

On storing value to ViewState issue is coming


I am placing my above code in the screen shot as enter image description here

The error screenshot is enter image description here

On placing this line I mean storing value to viewstate issue is coming, on deleting this line issue get resolves.

enter image description here

Whats the issue I dont know, Please suggest


Solution

  • As the error says, you need to mark your CommissionDistributionInfo class with the [Serializable] attribute.

    [Serializable]
    public class CommissionDistributionInfo
    {
        // implementation...
    }