使用AjaxForm上传文件时候,在IE下直接提示下载保存:

IE下AjaxForm上传文件直接提示下载的兼容性Bug

我的示例代码:

   return this.Json(
            new
                {
                    prop1 = 5,
                    prop2 = 10
                });

 这种问题只出现在IE下,是由于AjaxFrom只接受以Html格式返回的Json,所以需要在返回的json对象里设置content:

   return this.Json(
            new
                {
                    prop1 = 5,
                    prop2 = 10
                }, 
            "text/html");

 

 

 

相关文章:

  • 2021-07-11
  • 2022-12-23
  • 2021-06-10
  • 2021-11-20
  • 2022-12-23
  • 2021-12-31
  • 2021-07-07
  • 2021-06-07
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-06-11
  • 2021-12-23
  • 2021-09-27
  • 2022-12-23
相关资源
相似解决方案