65.9K
CodeProject is changing. Read more.
Home

No More Session Variable Misspellings

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.33/5 (3 votes)

Jun 22, 2011

CPOL
viewsIcon

9330

I prefer to wrap my session variables like this:public class MySession { public string MyValue { get { return Convert.ToString(Session["MyValue"]); } set { Session["MyValue"] = value; } }}

I prefer to wrap my session variables like this:

public class MySession {
  public string MyValue
  {
     get { return Convert.ToString(Session["MyValue"]); } 

     set { Session["MyValue"] = value; }
  }
}