Call ASP.NET function from JavaScript?

后端 未结 20 2231
暗喜
暗喜 2020-11-22 07:21

I\'m writing a web page in ASP.NET. I have some JavaScript code, and I have a submit button with a click event.

Is it possible to call a method I created in ASP with

20条回答
  •  天涯浪人
    2020-11-22 08:24

    You might want to create a web service for your common methods.
    Just add a WebMethodAttribute over the functions you want to call, and that's about it.
    Having a web service with all your common stuff also makes the system easier to maintain.

提交回复
热议问题