mike509123
MIS
Hi,
I have a modal dialog (window.showModalDialog) which contains the following link:
<a href='download.aspx?file=test.txt'>" + "test" + "</a>
Note: This issue only arises when the link is clicked from inside a modal dialog window.
IE6
When i click the link a blank window shows up, and then and then "save to dialog" box appears to save the file. The issue is why doesnt the blank window disappear and how can I make it disappear? (doing a window.close, cause the "save to dialog" box to disappear also.)
IE7
When i click the link a blank window shows up, and then almost immediately disapears and then "save to dialog" box appears to save the file.
Code of download.aspx:
string strRequest = Request.QueryString["file"];
if (strRequest != "") {
string path = Server.MapPath(strRequest);
System.IO.FileInfo file = new System.IO.FileInfo(path);
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
}
I have a modal dialog (window.showModalDialog) which contains the following link:
<a href='download.aspx?file=test.txt'>" + "test" + "</a>
Note: This issue only arises when the link is clicked from inside a modal dialog window.
IE6
When i click the link a blank window shows up, and then and then "save to dialog" box appears to save the file. The issue is why doesnt the blank window disappear and how can I make it disappear? (doing a window.close, cause the "save to dialog" box to disappear also.)
IE7
When i click the link a blank window shows up, and then almost immediately disapears and then "save to dialog" box appears to save the file.
Code of download.aspx:
string strRequest = Request.QueryString["file"];
if (strRequest != "") {
string path = Server.MapPath(strRequest);
System.IO.FileInfo file = new System.IO.FileInfo(path);
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
}