Posted on: 5/5/2011 10:57:32 AM | Views : 214

Hi all,
I've a problem with my coding. I've created a simple procedure to create an excel, zipping it and sending to browser with a SaveDialog. The problem is that after the code is executed, all web sites Sessions are deleted!
The button isn't in a Update Panel. The code is this
protected void cmdExcelExport_Click(object sender, EventArgs e) { //objects declaration StreamWriter sw; SqlCommand command; SqlDataReader reader; ExtractionProducer Producer; ZipFile XZip; //Working directory, it will be delete string TempDirectory = ...; string NewDirectoryPath = Server.MapPath(TempDirectory) + System.IO.Path.DirectorySeparatorChar + Guid.NewGuid().ToString(); //Create directory with unique name Directory.CreateDirectory(NewDirectoryPath); //Excel string ExcelFileName ...

Go to the complete details ...