I want to check that session is null or empty i.e. some thing like this:
if(Session[\"emp_num\"] != null)
{
if (!string.IsNullOrEmpty(Session[\"emp_num\"
Check if the session is empty or not in C# MVC Version Lower than 5.
if (!string.IsNullOrEmpty(Session["emp_num"] as string))
{
//cast it and use it
//business logic
}
Check if the session is empty or not in C# MVC Version Above 5.
if(Session["emp_num"] != null)
{
//cast it and use it
//business logic
}