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\"
If It is simple Session you can apply NULL Check directly Session["emp_num"] != null
But if it's a session of a list Item then You need to apply any one of the following option
Option 1:
if (((List)(Session["emp_num"])) != null && (List)Session["emp_num"])).Count > 0)
{
//Your Logic here
}
Option 2:
List val= Session["emp_num"] as List; //Get the value from Session.
if (val.FirstOrDefault() != null)
{
//Your Logic here
}