我有一個Aspx頁面。 開啓按鈕單擊我正在從服務器下載文件。文件下載後文件準備不工作
用於下載文件的服務器端代碼。 aspx頁面上
byte[] data = GetBytes();
//Sets the Content Type and FileName
HttpContext.Current.Response.ContentType = "plan/text";
HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", "Error.txt"));
//Writes the Content in HttpResponse
//to enable downloading the file.
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.BinaryWrite(data);
HttpContext.Current.Response.End();
JavaScript代碼。
$(document).ready(function() {
alert(1);
});
該警報是越來越顯示在第一頁的負荷。 但它在文件下載回發後不顯示警報。 在此先感謝。
最可能的是,你可能不會有一個回 –
@SubinJacob是文件下載頁面時要求越來越取消。他們的任何方式,我可以在downlaod完成後觸發一個javascript方法嗎? – sudhAnsu63