Nice way to define properties with StateContainer Attribute
StateContainer(ViewState)]
string FirstName
{
get;
set;
}
[StateContainer(Session)]
List<string> myList
{
get;set;
}
[StateContainer(Cache)]
List<string> myList2
{
get;set;
}
Just a random thought: I think it would be nice, with the help of an attribute, to be able to define where a given property would be stored.
I guess it also be applied at the class level, if you want all of your properties to inherti the same StateContainer Attribute.
A change probably best fit for an upcoming Framework release.
Just a thought.
1 comment
-
Gc-2011
commented
Wonderful idea. I strongly recommend this, specially for properties of web-pages :
[StateContainer("Session")]
public List<MyClass> MyPageData {get; set;}