you may need to add null check in getter of the property
public static string CurrentFolderPath
{
get
{
if (HttpContext.Current.Session["FolderPath"] == null)
return string.Empty;
else
return (string)HttpContext.Current.Session["FolderPath"];
}
set
{
HttpContext.Current.Session["FolderPath"] = value;
}
}
side note: to check string empty you can use
string.IsNullOrEmpty
method
if (!string.IsNullOrEmpty(SessionManager.CurrentFolderPath))
{
path = CommonFunctions.UserFolder;
}