Call ASP.Net function from javascript

Is it possible to call a C # function in my codeb with javascript?

+3
source share
2 answers

Yes, you can use PageMethods .

+4
source

You cannot call server code 'Directly from client code. Which is because, by design, the server side code is executed on the server side and client code on the client. However, there are some workarounds. to call serveride code from javascript, you will need to use AJAX, and the easiest way out is to use ASP.NET AJAX Extensions.

Mark this link

" " PageMethods ASP.NET AJAX

+1

Source: https://habr.com/ru/post/1771437/


All Articles