5
Answers

Session become null atomatically, Why?

Vikas Ahlawat

Vikas Ahlawat

13y
3.4k
1
when i execure the code for delete a folder then the session became null?
why?


code for delete the folder here

 DirectoryInfo thisThumnials = new DirectoryInfo(Server.MapPath("../Albums/" + categoryID + "/Images/" + "/ThumnailImages"));

 DeleteFolder(thisThumnials);

 public void DeleteFolder(DirectoryInfo df)
    {
        try
        {
            if (df.Exists)
            {
                foreach (FileInfo fi in df.GetFiles())
                {
                    fi.Delete();
                }
                if (df.Exists)
                {
                    df.Delete();
                }
            }
        }
        catch
        {
        }
    }

Answers (5)