1
所以,我有以下情形:ASP.NET:Response.BinaryWrite内UpdatePanel内儿童用户控制
--- Page.aspx ---
UpdatePanel
ListView
UserControl.ascx
--- UserControl.ascx - -
ListView
Button|ID:btnDownloadAttachment
我用下面的方法来立即下载附件:
public void OpenDocument(byte[] AttContent, string fileName, string inExtension)
{
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + inExtension);
Response.AddHeader("Content-Length", AttContent.Length.ToString());
Response.BinaryWrite(AttContent);
}
但由于内容更新面板,我得到以下错误内:
“Sys.WebForms.PageRequestManagerParserErrorException:Sys.WebForms.PageRequestManagerParserErrorException:从无法解析服务器收到的消息。”
您无法下载文件通过JAX。 – SLaks 2013-02-25 19:45:15
@SLaks我需要更新面板有反正我可以解决这个问题吗? – 2013-02-25 20:26:21
不需要您需要回传。 – SLaks 2013-02-26 00:42:14