Error Management in file download RRS feed

  • Question

  • User1973628327 posted


    I have a button with excel file download:

    onclick="window.open('@Url.Action("DownloadReport", "MyController")', '')"

    I need to show a message if an error occurs while generating files. I tried to use a function

    function downloadReport(){
                $.post("@Url.Action("DownloadReport", "MyController")", function (file) {

    From Controller

    return base.File(myFile, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName);

    But download doesn't starts because I lose attachments attribute from the response.

    How can I do that?

    Thursday, February 28, 2019 4:00 PM

All replies