I am trying to check if a Session state variable is null or no. If it is not null there is a function to be used. However this is throwing an exception.
When Session["Set_Parameters]
is null it is throwing an exception. I need it to avoid the if statement if it is null.
if(!string.IsNullOrEmpty(Session["Set_Parameters"].ToString()))
{
Edit_String();
}
System.NullReferenceException: 'Object reference not set to an instance of an object.'
System.Web.SessionState.HttpSessionState.this[string].get returned null.
This is the exception I am getting.