I'm working with MVC
I have a dialog in one of my views.
My dialog
$("#dialog-confirm").dialog({
autoOpen: false,
resizable: false,
height: 390,
width: 402,
modal: true,
buttons: {
"Generate Report": function () {
$.ajax({
type: "GET",
url: '/Report/Report',
data:
{
reportName : $('#dialogReportTypeID').val(),
reportData: $('#dialogPrintFormatSelector').val()"
},
dataType: 'html',
success: function(data)
{
$('body').html(data);
}
});
$(this).dialog("close");
},
Cancel: function () {
$("#cancel").text("");
$(this).dialog("close");
}
}
});
The Dialog calls a different controller. The controller returns an ActionResult to AJAX. The ActionResult is either HTML or a `FileStream' that is intended to be downloaded.
The page gets re-written with $('body').html(data);
but it seems like the serialized value of the FileStream
only gets passed back. since i see it on the screen without any format, just data...
Q: how can I download the file comming from the Controller's Action Result?