We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Server cannot set content type after HTTP headers have been sent.

Thread ID:





109313 Jun 6,2013 01:33 PM UTC Jun 10,2013 04:56 AM UTC ASP.NET Web Forms (Classic) 1
Tags: XlsIO
Bob Wallace
Asked On June 6, 2013 01:33 PM UTC

I am stuck as to why we are getting this error now. The code has worked for some time and now we are having issues.  Any ideas why we are getting this? I have done research on the web and most people say that you need to set the BufferOutput of the response to true. I have tried this an it does not fix the issue.

Possible problem code: 
workbook.SaveAs(Replace(title, " ", ""), ExcelSaveType.SaveAsXLS, response, ExcelDownloadType.PromptDialog)

ExceptionMessage: Server cannot set content type after HTTP headers have been sent.

   at System.Web.HttpResponse.set_ContentType(String value)
   at System.Web.HttpResponseInternalWrapper.set_ContentType(String value)
   at System.Web.UI.PageRequestManager.RenderPageCallback(HtmlTextWriter writer, Control pageControl)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Page.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Sridhar [Syncfusion]
Replied On June 10, 2013 04:56 AM UTC

Hi Bob Wallace,

Thank you for using Syncfusion products.

We are unable to reproduce the above reported exception at our side. Could you please try to save the excel file specfied in the below online sample link and let us know if this helps you.


If you still face the issue, please update us with the sample which reproduces the exception, the scenario for the creation of the sample.

Please let me know if you have any further clarifications.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon