Author: Prysson | Posted on: 7/10/2009 8:33:51 AM | Views : 250

 I have this code that executes on a button onclick event handler
 
System.Web.HttpResponse sa = System.Web.HttpContext.Current.Response;
sa.ClearContent();
sa.Clear();
sa.ContentType = "application/octet-stream";
sa.AddHeader("Content-Disposition", "attachment; filename=" + filename + ";");
sa.TransmitFile(path);
sa.Flush();
//response.End();
sa.Close();
ModalProgress.Hide();
 
there is some code before this snippet but it basically just determines the name and path for the file to be downloaded.
The thing is that if I remove the code associated with the System.Web.HttpResponse class then the button onlcick does a postback and the code to hide the modal popup works fine. But if I run the System.Web.HttpResponse associated code then even though the MOdalProgress.Hide(); gets run the pop up doesnt ...

Go to the complete details ...