How can i download csv file without ending The Action by using return Command?
I want to have an action that can download a csv file and continue with action logic. is it possible to initiate a request without actually end the action and return back from the controller? something like that :
public IActionResult AddOrdersExtension(OrderVM orderVM)
{
if (ModelState.IsValid)
{
StringBuilder sb = new StringBuilder();
//Header
sb.Append("Product,Empty,Name,Address1,Address2,City,State,zip,Country,Phone,Quantity,Weight");
FileContentResult fr = File(Encoding.ASCII.GetBytes(sb.ToString()), "text/csv",
"Error_log.csv");
//
//execute csv download
//
// continue with function
return View(orderVM.Orders); // return from action when logic is done
}//end function