i want to call the javascript function from the code behind until the javascript function process is not completed. should not come back to the code-behind.
below is my code-after getting the resposne from api now need to add value into table and dispaly
C#
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
all = JsonConvert.DeserializeObject(responseString);
ScriptManager.RegisterStartupScript(this, typeof(Page), "OnClientClicking", "divCloseAcntopen();", true);
GetAllOrders();
IdOfOrder=all.id;
GetordedsdsdsrById(IdOfOrder);javascript function
JavaScript
function divCloseAcntopen {
$('#tbodyid').empty();
$.ajax({
method: "POST",
url: "Defaulta.aspx/GetAllOrderss",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response)
{
for (var k = 0; k ' + response.d[1].id + ' ' + response.d[1].status + ' ' + response.d[1].side + '');
}
},
error: function (response) {
console.log("error")
console.log(response)
}
})
}
Sachin SinghRank #66 · 26.2K reputationPosted Jul 24, 2021, 4:49 AM EDT
Pradeep RawatRank #5,709 · 289 reputationPosted Jul 28, 2021, 12:58 AM EDT
Pradeep RawatRank #5,709 · 289 reputationPosted Jul 28, 2021, 7:37 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts