1
我想生成一个供用户下载的(报告)文件,然后向用户显示一条消息,以显示过程已成功完成。VB.net文件下载防止回发
Dim myFile As FileInfo = New FileInfo(<filepath>)
'My function to generate a report (this can take a few minutes)
GenerateReport(myFile.FullName)
'Prompt user with "save as" dialog box.
Response.Clear()
Response.ClearHeaders()
Response.AddHeader("Content-Disposition", "attachment; filename=" & _
Response.WriteFile()
'Give message to say generation is complete. (This line doesn't take effect)
lblMsg.Text = "Generation complete"
但是,当我使用创建一个“另存为”框,它似乎停止消息出现在所有。这是为什么?任何人都可以提出一个解决方法吗?
不明白为什么我被标记为此。我认为这个问题非常清楚,评论很好,简洁明了。 – Urbycoz 2011-04-15 11:59:20