Reputation: 722
I have a class named "City"
public class City
{
public int ID {get; set;}
public int StateID {get; set;}
public int CountryID{get; set;}
public string Name{get; set;}
.......
}
and i have an asp.net page named CityAdd.aspx, in this page i want to create a collection of city class that can be store in the viewstate. Is it possible to make a Generic Collection Serializable?
Upvotes: 0
Views: 66
Reputation: 63065
do as below, add Serializable attribute
[Serializable]
public class City
{
}
Upvotes: 1