Hi
i am very new to MVC and currently i got a requirement that i have to remove session from all the pages, so i should not store anything in session and have to replace with other concept to achieve this because don't logout from application.
currently in session i am just keeping login details and Module allowed and retrieving from other pages.you can see the below code to understand clearly
LoginCredential SessLogin = new LoginCredential();
SessLogin.ModuleAllowed = new List();
SessLogin.RLPEmpId ="V0008293"
SessLogin.RLPEmpName = "Santosh"
SessLogin.RLPEmpLocation = "India"
Var tempTop = somedatatable;
SessLogin.ModuleAllowed = tempTop;
Session["SessLogin"] = SessLogin;= SessLogin
---below two class used to assign value below storing in session.
public class LoginCredential
{
public string RLPEmpId { get; set; }
public string RLPEmpName { get; set; }
public string RLPEmpLocation { get; set; }
public List SECModule>; ModuleAllowed { get; set; }
}
public class SECModule
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int ID { get; set; }
public int ParentID { get; set; }
public string ModuleName { get; set; }
}
hope you understood if not then let me know