我在 IIS 7 上运行的 Asp.Net 网站的事件日志中收到以下警告。
Exception information:
Exception type: HttpException
Exception message: Server cannot append header after HTTP headers have been sent.
at System.Web.Hosting.ISAPIWorkerRequest.SendUnknownResponseHeader(String name, String value)
at System.Web.HttpResponse.WriteHeaders()
at System.Web.HttpResponse.Flush(Boolean finalFlush)
at System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext context, Exception e)
我试图调试网站,但它只是没有在调试器中显示。出现此问题的网页包含以下内容。
- 它是一个带有母版页的内容页。
- 它在由定时器触发的 UpdatePanel 中有一个网格。
- 在指定的时间刷新网格数据。
每次发生这种情况时,我们都会在 EventLog 中看到一个新警告。解决这个问题的最佳方法是什么?