I have a button that uses jquery and ajax to call a server side script to create a text file and sends back the following response
Response.ContentType = "csv";
Response.AddHeader("Content-disposition", "attachment; filename=" + fName);
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(btFile);
Response.End();
However the save dialog does not appear. If I don't use ajax and perform a full postback with the same code it works. Any ideas?
Here is the jquery code
$(function() {
$('#reportButton').click(function() {
$.ajax({
type: "POST",
url: "GenerateReport.aspx",
data: "id=0",
success: function(){
}
});
});
});