Calling ASP.NET Code Behind function from JavaScript

前端 未结 6 755
梦毁少年i
梦毁少年i 2020-11-29 08:45

Is it possible to call ASP.NET codebehind function from JavaScript.

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 09:45

    No, it is not possible to call ASP.NET code behind function from Javascript directly. ASP.NET code behind executes on the server in the context of the ASP.NET worker process. Javascript is executed on the client in the context of the client's browser.

    The only way Javascript could trigger execution of ASP.NET code behind is through making an AJAX call from the Javascript to the server.

提交回复
热议问题