my
CodeShare
A Developer Community Promoting Open Information Exchange
Home
:
Export to CSV from the ASP.NET using C#
Links
Register
Login
Export to CSV from the ASP.NET using C#
Here is some sample code for outputting some CSV content from the web to a browser, as a downloadable CSV file.
var
delimitedOutput = 'test,me,now' Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.AddHeader(
"content-disposition"
,
"attachment; filename=thefile.csv"
; Response.ContentType =
"text/csv"
; Response.AddHeader(
"Pragma"
,
"public"
); Response.Write(delimitedOutput); Response.End();
Written By: mycodeshare on March 18, 2009 at 21:48
Submit a comment, suggestion, or additional information about this snippet
If you
login
or
register
, you'll be able to post a comment or provide feedback about this snippet.
Contact Us
|
Terms of Use
Copyright © 2009 myCodeShare.com