0
Hello, How can I stop the execution of Setimeout created in javascript only in C#? I Gero several PDF through this method.
Below is the script:
function geracao(formulario) {
window.setTimeout(function () {
document.getElementById('<%=btn_PDFSIM.ClientID%>').click();
}, 5000);
}
There is no way to stop setTimeout because it only runs 1 time. You could stop him with clearTimeout() if he was making some kind of loop, and that you only get on the client side through the JS itself.
– Sam
The Javascript code runs on the client side, specifically within the context of the browser used to access the site, which will have its own engine for interpreting the script. C# in this case would run on the server side. There is no way the server-side code converses with the client-side, let alone interact with the timers created by the browser engine that is accessing the site. At least I don’t see how it could happen!
– Pedro Gaspar