Server cannot append header after HTTP headers have been sent?
I am getting the following warnings on the Event Log for a Asp.Net WebSite running on IIS 7.
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)
I tried to debug the WebSite but it just does not show in deb开发者_如何学运维ugger. The web page which has got this issue contains the following.
- Its a content page with a Master page.
- It has a grid inside an UpdatePanel which is Triggered by a Timer.
- On the specified time grid data is refreshed.
Everytime this happens we see a new warning in the EventLog. What is the best way to go about this issue?
You have a control that is misbehaving. You may add headers at any point before any content is written to the response stream, after that point adding a header will throw.
The exception is being thrown deep so you will have to try Debug>Exceptions>Common Language Runtime Exeptions and check 'thrown'. It may now be possible to break on the exeption and examine the inner exception or trace the call stack and find out who is being bad.
精彩评论