Is there any convention for naming session variables in ASP.NET?
Options that come to my mind:
Session["myValue"] = "value";
Session["MyValue"] = "value";
Session["my_value"] = "value";
Session["MY_VALUE"] = "value";
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
IMO, it is important to apply the DRY principle:
and then:
I don’t think it matters much which string literal you use, as long as it is unique enough and you do it in a consistent way, like others have mentioned.