此代码将始终使我的aspx页面加载两次。这与AutoEventWireup无关。C#写入输出流
Response.Clear();
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "inline;filename=data.pdf");
Response.BufferOutput = true;
byte[] response = GetDocument(doclocation);
Response.AddHeader("Content-Length", response.Length.ToString());
Response.BinaryWrite(response);
Response.End();
这段代码只会让我的页面加载一次(因为它应该),当我硬编码一些虚拟值。
Response.Clear();
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "inline;filename=data.pdf");
Response.BufferOutput = true;
byte[] response = new byte[] {10,11,12,13};
Response.AddHeader("Content-Length", response.Length.ToString());
Response.BinaryWrite(response);
Response.End();
我也增加了web.config文件中的好措施的请求长度。
<httpRuntime executionTimeout="180" maxRequestLength="400000"/>
还没有。任何人都看到我不喜欢的东西?
此代码在哪里? – 2009-01-19 00:37:58