Hi,
From Jquery ajax i am making a C# function call which is returing a file download option.
If i am using $.ajax, it is not working, if i am giving window.location = url then that download box is coming.
I am trying to download one excel file.
I have given this content type:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet in the c# response object and writing that C# response object property OutputStream write to memorystream object with the proper response header.
Below is the AJAx code which i am using to call the URL.
$.ajax({
url: controllerUrl,
type: 'Get', contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
beforeSend: function (xhr) {
xhr.overrideMimeType('text/plain; charset=UTF-8')
$(that.el).parent().block({ message: "Processing..." });
},
success: function (data) {
},
complete: function (data) {
$(that.el).dialog('close');
},
error: function (jqXHR,textStatus) {
alert("hi");
}
Please let me know if i missed anything. .