Reputation: 27
HI i want to use such thing in my web application that on a button click .aspx page converted in Xls page. I did it but result is not good as I needed. I used this code on button click which is given below.
Response.Clear();
Response.Buffer = true;
string filename = "TicketSecretary.xlxs";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
Upvotes: 0
Views: 4209
Reputation: 460158
I'm missing the Response.End();
at the end.
http://msdn.microsoft.com/en-us/library/system.web.httpresponse.end.aspx
Upvotes: 1