Этот код всегда заставляет мою страницу aspx загружаться дважды. И это не имеет ничего общего с AutoEventWireup.
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"/>
Все еще ничего. Кто-нибудь видит что-то, чего я не вижу?