Using Jquery and Ajax to save a file in ASP.Net

人盡茶涼 提交于 2019-12-05 06:11:27

Rather than using AJAX (which will not work, as Brian mentions), you can fake it by using jQuery to dynamically create a form and an iframe to post it to. Here is an example I found -- you should read through the comments for some improvements (like the use of a dynamically created iframe to prevent problems if your page does not return the proper headers).

Brian Mains

I think the issue is the AJAX, and if the request was made as a standard request outside JQuery, you would get the save dialog box. JQuery requests would stream the data to the callback...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!