views:

30

answers:

1

Hello, I'm trying to stored a Linq To SQL Entity within a ViewState. However when I do so, it results in the following error: Error serializing value 'System.Collections.Generic.List1[RequireApps.RequireLinqDataAccess.GroupMember]' of type 'System.Collections.Generic.List1[[RequireApps.RequireLinqDataAccess.GroupMember, RequireApps.RequireLinqDataAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].'

Anyone have any ideas on how to get around this issue?

Thanks! Rusty

A: 

Anything you add to ViewState must be serializable, so you need to mark RequireApps.RequireLinqDataAccess.GroupMember as Serializable:

namespace RequireApps
{
    [Serializable]
    public class GroupMember
    {

    }
}
GenericTypeTea