簡體   English   中英

使用UpdatePanel從流中下載文件

[英]Download file from stream using UpdatePanel

我們正在嘗試像這樣從字節流下載文件:

            byte[] arrBytes = x.Result;
            Response.ClearContent();
            Response.ClearHeaders();
            Response.Buffer = true;
            Response.ContentType = file.MimeType;
            Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Title);
            Response.OutputStream.Write(arrBytes, 0, arrBytes.Length);
            Response.Flush();

其工作沒有更新面板,但使用更新面板不會被下載。 請提出一些解決方法。

可能您正在使用<asp:AsyncPostBackTrigger> ,請將其替換為<asp:PostBackTrigger>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM