Hi @Ashok Kumar,
I tested your code and I think it's because of the version of the library you are using.
You can use the following libraries.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js'></script>
<link rel="stylesheet" href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css' />
and delete the code circled below.
All Code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js'></script>
<link rel="stylesheet" href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css' />
<script>
function plreportexportexcel_pdftoemail() {
$("#modal_loader").modal('show');
var msg = Successmessage("abc");
if (msg != "") {
$("#modal_loader").modal('hide');
}
}
function Successmessage(clientcode) {
//$("#modal_loader").modal('show');
var sus = "";
var param = { clientcode: clientcode };
var res = $.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "reports.aspx/GenerateCustomPDF_ExcelBulk",
dataType: "json",
//data: "{}",
data: JSON.stringify(param),
success: function (response) {
//$("#modal_loader").modal('hide');
sus = response.d;
},
async: false,
error: function (err) {
console.log("eror is ==> .. " + err);
}
});
return sus;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="modal fade " id="modal_loader" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-bs-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-body">
<div class="form-group row">
<div class="loader"> <img src="8.gif" /></div>
<p> <center>you will receive messages shortly please wait a moment once done popup will close</center></p>
</div>
</div>
</div>
</div>
</div>
<a href="javascript://" title="Export to Whatsapp" id="plrepobulkwhatsapp" onclick="plreportexportexcel_pdftoemail()" class="btn btn-success">Email</a>
</form>
</body>
</html>
[WebMethod]
public static string GenerateCustomPDF_ExcelBulk(string clientcode)
{
string msg = "aaa";
//Here I written my required logic and returned the success message
//msg = "success";
return msg;
}
Here are my test results:
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.