Am dowloading a file using JQUERY MVC. User clicks on button and am downloading the File looks as simple as it is.
My Jquery Event
$(document).on("click", "#download", function () {
$.blockUI();
window.location = "../Home/Download";
$.unblockUI();
}
and which calls my server side
public ActionResult Download()
{
return File();
}
Everything is fine Except that am using Block UI(Jquery Plugin) to keep the user know that Download is in progress..."Please wait"
and once the Download is complete i need to unblock UI and let the user Save/open file. how can i modify the above code to achieve this or any other idea ??
Currently my c# code is called and the next line in jquery is executed and block ui is Gone next sec. how can i make the process wait until the download completed ?