M
Marc Ris
Hi,
Following problem, and I can't find any solution for that:
I have an aspx page, which will (finally) generate an XLS-File which must
(can) be downloaded from the user. After that, the window should close
automatically.
Well, the first part for itself is easy with Response.WriteFile().....
The second one for itself is also easy with JS window.close()
Well, combining them seems to be much complicated. The file will be
downladed, but there's no "auto-close" effect.
Any suggestions ?
WBR,
Marc
<snip>
string script = "<script language='javascript'>window.close()</script>";
Response.ClearContent();
Response.ClearHeaders();
Response.Clear();
Response.ContentType = "application/zip;filename=download.zip";
Response.AppendHeader("Content-Disposition",
"attachment;filename=download.zip");
Response.AppendHeader("Content-Length", fi.Length.ToString());
Response.WriteFile(zipFile, 0, fi.Length);
Response.Write(script);
if(!IsStartupScriptRegistered("closepopup"))
this.RegisterStartupScript("closepopup", script);
Response.Flush();
</snap>
Following problem, and I can't find any solution for that:
I have an aspx page, which will (finally) generate an XLS-File which must
(can) be downloaded from the user. After that, the window should close
automatically.
Well, the first part for itself is easy with Response.WriteFile().....
The second one for itself is also easy with JS window.close()
Well, combining them seems to be much complicated. The file will be
downladed, but there's no "auto-close" effect.
Any suggestions ?
WBR,
Marc
<snip>
string script = "<script language='javascript'>window.close()</script>";
Response.ClearContent();
Response.ClearHeaders();
Response.Clear();
Response.ContentType = "application/zip;filename=download.zip";
Response.AppendHeader("Content-Disposition",
"attachment;filename=download.zip");
Response.AppendHeader("Content-Length", fi.Length.ToString());
Response.WriteFile(zipFile, 0, fi.Length);
Response.Write(script);
if(!IsStartupScriptRegistered("closepopup"))
this.RegisterStartupScript("closepopup", script);
Response.Flush();
</snap>