Using text/csv
is the most appropriate type.
You should also consider adding a Content-Disposition
header to the response. Often a text/csv will be loaded by a Internet Explorer directly into a hosted instance of Excel. This may or may not be a desirable result.
Response.AddHeader("Content-Disposition", "attachment;filename=myfilename.csv");
The above will cause a file “Save as” dialog to appear which may be what you intend.
Related Posts:
- HTTP Error 503, the service is unavailable
- How to resolve “Server Error in ‘/’ Application” error?
- Chrome returns “Bad Request – Request Too Long” when navigating to local IIS Express
- What does ‘IISReset’ do?
- What does ‘IISReset’ do?
- “Exception has been thrown by the target of an invocation” error (mscorlib)
- ORA-12154 could not resolve the connect identifier specified
- What are .ashx files in an ASP.NET application?
- Does PHP supports MVP pattern?
- Server.Transfer Vs. Response.Redirect
- W3WP.EXE using 100% CPU – where to start?
- HTTP Error 403.14 – Forbidden – The Web server is configured to not list the contents of this directory
- Error :The remote server returned an error: (401) Unauthorized
- Exception of type ‘System.OutOfMemoryException’ was thrown.
- Cannot read configuration file due to insufficient permissions
- A potentially dangerous Request.Form value was detected from the client
- Could not load file or assembly ‘Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’
- How to Determine IUSR Password
- ASP.NET Why are sessions timing out, sessionstate timeout set
- What does aspnet_regiis.exe do
- drop down list value in asp.net
- Cannot read configuration file due to insufficient permissions
- Can you recommend a .net template engine?
- How do I resolve “HTTP Error 500.19 – Internal Server Error” on IIS7.0
- Asp.net Hyperlink control equivalent to
- Error ‘2035’ (‘MQRC_NOT_AUTHORIZED’) While Connecting to MQ
- debug=true in web.config = BAD thing?
- Url.Action parameters?
- What is the difference between ASP.NET and ASP.NET MVC?
- Failed to load resource: the server responded with a status of 401 (Unauthorized) /App/AngularJS/angular.min.js
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- ASP.NET DateTime Picker
- Could not load file or assembly ‘Microsoft.CodeDom.Providers.DotNetCompilerPlatform
- a page can have only one server-side form tag
- “This operation requires IIS integrated pipeline mode.”
- Could not load file or assembly ‘Microsoft.ReportViewer.WebForms’
- Maximum request length exceeded.
- Could not load file or assembly Exception from HRESULT: 0x80131040
- The localhost page isn’t working. localhost redirected you too many times
- Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive
- IIS error, Unable to start debugging on the webserver
- How to move div vertically down using CSS
- How to troubleshoot “System.Web.HttpException (0x80004005): File does not exist”?
- jquery $(this).id return Undefined
- How handle Application Error Exception code: 0xc00000fd
- C# function to return array
- “The transaction log for database is full due to ‘LOG_BACKUP'” in a shared host
- jQuery UI ” $(“#datepicker”).datepicker is not a function”
- TypeError: list indices must be integers or slices, not str
- What is the difference between POST and PUT in HTTP?
- What is the difference between POST and PUT in HTTP?
- Should a 502 HTTP status code be used if a proxy receives no response at all?
- IndexError: too many indices for array
- IndexError: too many indices for array
- SOAP vs REST (differences)
- Writing a pandas DataFrame to CSV file
- What is the difference between a URI, a URL and a URN?
- C# HttpClient An existing connection was forcibly closed by the remote host
- Writing a pandas DataFrame to CSV file
- HTTP Status 504
- How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()
- What is the difference between POST and GET? [duplicate]
- Chrome hangs after certain amount of data transfered – waiting for available socket
- The wait operation timed out. ASP
- Use of PUT vs PATCH methods in REST API real life scenarios
- The wait operation timed out. ASP
- Do I need Content-Type: application/octet-stream for file download?
- How to redirect all HTTP requests to HTTPS
- Problem HTTP error 403 in Python 3 Web Scraping
- application/x-www-form-urlencoded or multipart/form-data?
- Different between ./ , ../ , ../../ , ~/ on file path(URL) in asp.net
- Problem HTTP error 403 in Python 3 Web Scraping
- IndexError: too many indices for array
- Why Puma listen on ‘tcp://localhost:3000’ instead of ‘http://localhost:3000’
- application/x-www-form-urlencoded or multipart/form-data?
- ValueError : I/O operation on closed file
- Is 418 “I’m a teapot” really an HTTP response code?
- How to download a file over HTTP?
- How to define the basic HTTP authentication using cURL correctly?
- How to resolve “Input string was not in a correct format.” error?
- How to download a file over HTTP?
- How to define the basic HTTP authentication using cURL correctly?
- “Cannot GET /” with Connect on Node.js
- Pandas: ValueError: cannot convert float NaN to integer
- csv.Error: iterator should return strings, not bytes
- The request was aborted: Could not create SSL/TLS secure channel
- “CAUTION: provisional headers are shown” in Chrome debugger
- Axios Delete request with body and headers?
- ASP.NET 5 MVC: unable to connect to web server ‘IIS Express’
- Is “ ” a replacement of ” “?
- Twilio TwilioRestClient does not contain a definition for SendSmsMessage
- How to add a default Default.aspx to a ASP.NET Web Application Project?
- how does Request.QueryString work?
- how to call jquery selector from outside kendo window?
- Yahoo! Finance CSV file will not return Dow Jones (^DJI)
- @ converted to %40 in HTTPPost request
- The request was aborted: Could not create SSL/TLS secure channel
- Net 2.0 Framework Service Pack 2 Issue
- The request was aborted: Could not create SSL/TLS secure channel