window.showModalDialog()弹出的窗口 里面有下载链接 如何让这下载好用
if (File.Exists(Server.MapPath(filePath)))
{
string strFileName = Path.GetFileName(filePath).Replace(" ", "%20");
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName);
Response.Clear();
Response.WriteFile(Server.MapPath(filePath));
Response.End();//到此行也不报错 ,就直接没反应了
}
window.showModalDialog()弹出的窗口 里面有下载链接 如何让这下载好用???求帮忙!!!
[解决办法]
你直接在模态对话框中加一个a标签
<a id="hi" onclick="loadFile()">abc</a>
function loadFile()
{
window.location = "filepath";
}