$("#btnGenerateReport").click(function () {
$.ajax({
type: "POST",
url: '@Url.Action("GenerateReport", "ProcessInputData")',
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (response) {
if (response.success) {
window.location = '@Url.Action("Download", "ProcessInputData")';
}
else {
$("#errorModalMessageId").html(response.responseText);
$('#errorModal').modal('show');
}
},
error: function (ex) {
var r = jQuery.parseJSON(response.responseText);
$("#errorModalMessageId").html("Message: " + r.Message + "\nStackTrace: " + r.StackTrace + "\nExceptionType: " + r.ExceptionType);
$('#errorModal').modal('show');
}
});