I'm calling a JS fcn that fires AJAX to a webmethod and returns a boolean. How do I retrieve the return value in the codebehind? (VB) I can set a hiddenfield value in the JS, but if it's async how can my VB know when it's changed?
Answer / Mohd Faim
In ASP.NET (VB), you can use an UpdatePanel or AJAX Timer to ensure that your code-behind knows when the JavaScript function returns a value. The updated hiddenfield value will be accessible in the code-behind during the Page_Load event or specific event handlers.
| Is This Answer Correct ? | 0 Yes | 0 No |
how to remove or delete multiple selected items from listbox in on button click in asp?
How to call JavaScript Function from Code-behind in asp.net?
How a web page can communicate with a web server while a user type characters in an input field.
I'm calling a JS fcn that fires AJAX to a webmethod and returns a boolean. How do I retrieve the return value in the codebehind? (VB) I can set a hiddenfield value in the JS, but if it's async how can my VB know when it's changed?
How to Print Asp.net GridView Data on Button Click using Javascript?