事件代码如下:(实现的功能是直接下载文件,不使用IE默认打开)
当用window.open方法打开网页一切正常
打开模式窗口就不能执行private void link_Click(object sender,EventArgs e)
{
string _Path = ((LinkButton)sender).CommandArgument;
string FileName = ((LinkButton)sender).CommandName;
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;FileName=" + HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8));
Response.WriteFile(Server.MapPath(_Path));
Response.End(); }
当用window.open方法打开网页一切正常
打开模式窗口就不能执行private void link_Click(object sender,EventArgs e)
{
string _Path = ((LinkButton)sender).CommandArgument;
string FileName = ((LinkButton)sender).CommandName;
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;FileName=" + HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8));
Response.WriteFile(Server.MapPath(_Path));
Response.End(); }
<META http-equiv="PRAGMA" content="no-cache">
模式窗口不能点刷新,常常中招