翻了一天的资料,没找到答案
dim myfile as new System.IO.FileInfo(filename)
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment;filename='aaa.xls'"
mysqlreader.close()
mycon.close()
Response.AddHeader("Content-Length", cstr(myfile.Length))
Response.ContentType = "application/octet-stream"
Response.WriteFile(myfile.FullName)
Response.end()能够正常下载保存,但是这段程序执行后,页面上的所有其他程序都不灵了,包括按钮事件,超连接等。本来我想在下载结束后提示一下,结果后面的语句也是不会执行,到底怎么解决啊,求各位大哥大姐援手啊。小弟不胜感激
dim myfile as new System.IO.FileInfo(filename)
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment;filename='aaa.xls'"
mysqlreader.close()
mycon.close()
Response.AddHeader("Content-Length", cstr(myfile.Length))
Response.ContentType = "application/octet-stream"
Response.WriteFile(myfile.FullName)
Response.end()能够正常下载保存,但是这段程序执行后,页面上的所有其他程序都不灵了,包括按钮事件,超连接等。本来我想在下载结束后提示一下,结果后面的语句也是不会执行,到底怎么解决啊,求各位大哥大姐援手啊。小弟不胜感激
解决方案 »
- DataReater的一问题
- 163的按纽效果怎么做出来的呀!-----163的按纽效果怎么做出来的呀!----163的按纽效果怎么做出来的呀!
- ASP.Net如何打開Doc,Xls文件??
- 装.net后,aspx的可以运行,但有连接access的asp页面不能运行,没有连接access的asp页面可以运行?(求救)
- 跨域获取登录名的实现任务,有酬劳!
- 哪有Visual Studio .NET 2003 中文专业版特别版下载??
- 2个系统之间的变量传递问题?
- DataSet中有三个表,我要把这三个表的数据放到一个表中,怎么弄呢?
- 在ASP.NET+C#中使用MessageBox的错误
- 关于gridview绑定数据问题
- 自定义控件位置样式问题?谁能帮帮我呀?
- 刷新另一个框架的页面如何执行PAGE_LOAD事件?
可是我下载完成后还有代码呢,转到其他页面,后面代码也没法执行了呀
这个我也是新手,期待高手过来吧
改成另一个关键字就ok了
可是搂主不行,因为xls系统是认识的
关注一下这个问题开新窗口,
Dim sScript As String _
= "<script language='JavaScript'>" _
& "window.open(""" & sLink & """, ""_top"", ""titlebar=yes,menubar=no,toolbar=no,status=yes,left=0,top=0,width=1024,height=700"", false);</script>"
oPage.RegisterStartupScript("OpenNewWin", sScript)
button1_click(...)
{
Response.Redirect("b.aspx");
}b.aspx
page_load(...)
{
//file的路径可以从a获得
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment;filename='aaa.xls'")Response.AddHeader("Content-Length", cstr(myfile.Length))
Response.ContentType = "application/ms-excel";
Response.WriteFile(myfile.FullName)
Response.end()}
page_load()
{
.............
Response.Write("<script>window.close();</" + "script>");
}
Page.RegisterStartupScript
然后在b.aspx里的page_load(...)
{
//file的路径可以从a获得
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment;filename='aaa.xls'")Response.AddHeader("Content-Length", cstr(myfile.Length))
Response.ContentType = "application/ms-excel";
Response.WriteFile(myfile.FullName)
Response.end()}b.aspx页面关闭后,并没有回到LinkButton的Click事件中,去继续执行Response.Redirect("b.aspx")后面的语句。