Following is the code to check cookie value in MVC and use to manage menu(or any other item) item in CsHTML
@if(Functions.ReadCookie("CookieName")=="1") {
@Html.ActionLink("Admin Users", "Index", "Admin", null, new { @class = Model == "Admin" ? "active" : "" })
}
@if(Functions.ReadCookie("CookieName")=="1") {
@Html.ActionLink("Admin Users", "Index", "Admin", null, new { @class = Model == "Admin" ? "active" : "" })
}
No comments:
Post a Comment