View csv in browser download the file
This article explains how to create and download csv files using existing data in ASP.NET MVC projects. This method is useful The web browser is launched to view the HTML file, while Excel will be spawned to view the CSV file.