private void FileDownload(string FullFileName)
{
FileInfo DownloadFile = new FileInfo(FullFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer=false;
Response.ContentType="application/octet-stream";
Response.AppendHeader("Content-Disposition","attachment;filename=" +HttpUtility.UrlEncode(DownloadFile.FullName,System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();
}
我使用上面的下载方法来下载,下载后,再次点击该连接或其他连接,javacript
出现拒绝访问的错误
(p下不会,在2000下会,怎么解决谢谢)
另:在有的机器上打开下载对话筐后,点保存->取消/保存, 会把整个程序关闭,什么原因啊)
{
FileInfo DownloadFile = new FileInfo(FullFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer=false;
Response.ContentType="application/octet-stream";
Response.AppendHeader("Content-Disposition","attachment;filename=" +HttpUtility.UrlEncode(DownloadFile.FullName,System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();
}
我使用上面的下载方法来下载,下载后,再次点击该连接或其他连接,javacript
出现拒绝访问的错误
(p下不会,在2000下会,怎么解决谢谢)
另:在有的机器上打开下载对话筐后,点保存->取消/保存, 会把整个程序关闭,什么原因啊)
但没办法隐藏或关闭那个单独的aspx如果用window.location.href=那个单独的aspx可以隐藏,却又解决不了上面的问题
function gog()
{
w = window.open("url","","resizable=yes,copyhistory=yes,scrollbars=yes,status=no,location=no,toolbar=no,menubar=no");
setTimeout(cc,3000);
}
function cc()
{
w.close();
window.location.href=window.location.href;
}<input id="btnex" onclick="gog();" type="button" value="Export" >
但没办法隐藏或关闭那个单独的aspx
如果用window.location.href=那个单独的aspx可以隐藏,却又解决不了上面的问题为什么不用HyperLink这个com呢,把它的NavigateUrl设为你要打开的地址,然后不用做任何事。也不会出现你所说的现象。
为什么还是出来js错误呢?