Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i'm new in mvc i have a problem for checking session variable is null r not in a mvc views side


Welcome
@if (Session["firstname"] != null && Session["lastname"] != null)
{
@Session["firstname"] @Session["lastname"]
}
else
{
@Html.Action("Login", "Login");
}
Posted
Comments
Sergey Alexandrovich Kryukov 12-Sep-14 22:57pm    
Okay, you have the problem. And what' is that problem?
—SA

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900