showModalDialog出来的窗体无法执行下载操作
普通的一个aspx页面,可以通过
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition","attachment;filename=" +HttpUtility.UrlEncodefi.FullName,System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length",fi.Length.ToString());
Response.WriteFile(fi.FullName);
Response.Flush();
Response.End();
这样比如在button_click里面,就可以自动打开下载对话框了。
但是如果同样的代码放到用showModalDialog打开的页面里面,好像就不行了。
原因好像是由于加了<base target=_self />。但是这句又不能去掉。
听说可以用frame解决,不知道是什么方法。