此代碼將始終使我的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