Reputation: 29427
Hello I am generating an excel file inside my action that I would return to the user. How do I have to declare the action to return a file?
May I call this action with ajax?
thanks!
Upvotes: 6
Views: 5341
Reputation: 1595
Option 1: Use built in ActionResults, such as FilePathResult, FileStreamResult, FileContentResult
Option 2: Build a custom ActionResult to return your excel file (example: http://www.dotnetcurry.com/ShowArticle.aspx?ID=484&AspxAutoDetectCookieSupport=1)
Upvotes: 16