I suggest you ...

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.

22 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    NaumanNauman shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Gc-2011Gc-2011 commented  ·   ·  Flag as inappropriate

        Wonderful idea. I strongly recommend this, specially for properties of web-pages :

        [StateContainer("Session")]
        public List<MyClass> MyPageData {get; set;}

      Feedback and Knowledge Base