How to export data to Excel/CSV file in ASP.NET
protected void Page_Load(object sender, EventArgs e) { Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("content-disposition", "attachment;filename=Attendees.csv"); Response.Charset = ""; Response.Write("Header\r\nContentetc."); Response.End(); }
No comments:
Post a Comment