I have implemented a partial view in my projects. Below is the Ajax code I am using:
$("#btnAdd").on("click", function () {
var formData = new FormData();
var dhnFiles = $("#fileDHN")[0].files;
if (dhnFiles.length == 0) {
alert("Please select a DHN file first!");
return;
}
for (var i = 0; i < dhnFiles.length; i++) {
formData.append("DataDHN", dhnFiles[i]);
}
$.ajax({
method: "POST",
url: "@Url.Action("PartialViewTableDataDHN")",
data: formData,
contentType: false,
processData: false
}).done(function (data) {
$("#TableDHN").html(data);
}).fail(function () {
alert("Error submitting data to server.");
});
});
The loading process takes about 20 minutes. I want the user to be patient and avoid closing the window. How can I display the message 'Please wait, don't close the windows' during the loading?
Thank you.