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

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


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).


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...