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