Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/427.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 当我通过Jquery.post()传递主函数时,Response.Write函数不工作_Javascript_C#_Jquery_Http Post - Fatal编程技术网

Javascript 当我通过Jquery.post()传递主函数时,Response.Write函数不工作

Javascript 当我通过Jquery.post()传递主函数时,Response.Write函数不工作,javascript,c#,jquery,http-post,Javascript,C#,Jquery,Http Post,我有一个函数ExportToExcel,它使用response.write将html数据导出到excel。我使用jquery方法post在单击按钮时运行此函数 function ExportToExcel() { ShowNotification('Exporting to Excel', false); $.post(exportUrl, null, function (jsonresponse) { HideNotification(); }); 问

我有一个函数ExportToExcel,它使用response.write将html数据导出到excel。我使用jquery方法post在单击按钮时运行此函数

function ExportToExcel() {
    ShowNotification('Exporting to Excel', false);
    $.post(exportUrl, null, function (jsonresponse) {
        HideNotification();
    });

问题是,如果使用post方法,excel文件未下载。如果我在没有通过Jquery运行的情况下使用这个函数,它会运行良好并下载文件。我是不是遗漏了什么

在这种情况下,不需要使用jquery。 只需使用链接或发布表单


搜索下载pdf jquery.post,您会发现许多解释和替代解决方案。

我需要jquery在文件下载时提供加载通知,这就是为什么我不能单独使用它的原因:这一个: