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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

109313 Jun 6,2013 09:33 AM Jun 10,2013 12:56 AM ASP.NET Web Forms (Classic) 1
loading
Tags: XlsIO
Bob Wallace
Asked On June 6, 2013 09:33 AM

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.

StackTrace:
   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 12:56 AM

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.

http://asp.syncfusion.com/demos/reporting/xlsio/Getting%20Started/CreateSpreadsheet/CS/CreateSpreadsheet.aspx

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.

Thanks,
Sridhar.S


CONFIRMATION

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.

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.

;