我有兩個.aspx頁面。在第一頁中,我有一個按鈕,在其單擊事件頁面上重定向到第二頁。在第二頁的page_load事件中,我寫了一個代碼來下載文件。在頁面之後下載文件顯示
它的工作原理..但我需要下載該文件時,第二頁是在瀏覽器完全加載(手段,我就能夠看到第二頁的所有內容)
這裏是我的代碼
頁-1
protected void ibtnReset_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Page-2.aspx");
}
頁-2
protected void Page_Load(object sender, EventArgs e)
{
// code to download file
}
你可以把你的下載代碼? –