TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ankit Agarwal
NA
379
252.7k
Server can't append header after HTTP headers have been send
Oct 12 2015 7:34 AM
Hello,
How to resolve this error "Server cannot append header after HTTP headers have been sent".
When i run second function for download excel, its getting error.
public void ExportQRCodeGenerateImageTableData(string data)
{
string attach = "attachment;filename=QRGenerateImage.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attach);
Response.ContentType = "application/ms-excel";
Response.Write(data);
Response.Flush();
//Response.End();
}
public void ExportAllCustomerTableData(string data)
{
string attach = "attachment;filename=CustomerDetails.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attach);
// Error:Server cannot append header after HTTP headers have been sent.
Response.ContentType = "application/ms-excel";
Response.Write(data);
//Response.End();
Response.Flush();
}
Please help me.
Thanks in Advance
Ankit Agarwal
Software Engineer
Reply
Answers (
1
)
How do I lockand unlock a table in sql server 2008
MVC Question