Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

No More Session Variable Misspellings

By , 22 Jun 2011
Rate this:
Please Sign up or sign in to vote.

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; }
  }
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

bruno1234

Unknown
No Biography provided

Comments and Discussions

 
Generalcool dude :) Pinmembersagarworlds27-Jun-11 19:09 
GeneralReason for my vote of 4 yes i used to the same Pinmembercode in play23-Jun-11 1:02 
Generalyes i used to the same Pinmembercode in play23-Jun-11 1:02 
GeneralSee my alternate. It is like your alternate, except a few th... PinprotectorAspDotNetDev22-Jun-11 14:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 22 Jun 2011
Article Copyright 2011 by bruno1234
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid