I am using code below, the session variables are declarated in Common class and under SessionVariables struct.
The session variable name become pretty long to use, do you have any idea how variable names can be minimized in my situation? Can I use variable name like SessionVariables.IsLogout without including class name?
Session[Common.SessionVariables.IsLogout]
public class Common
{
public struct SessionVariables
{
public static string IsLogout = "IsLogout";
}
}
You can use a
usingalias directive. You will then be able to access the variable asSV.IsLogoutas in this example: