Calling ASP.NET Code Behind function from JavaScript

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

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

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 09:19

    yes, you can make web method like..

     _ 
    Public Shared Function updateContent() As String
          Return "Your String"
        End Function
    

    and then call in javascript like..

    PageMethods.updateTabContent(parameterValueIfAny, onSuccessMethod,onFailMethod);
    

    this also need to add

    
                    
    

提交回复
热议问题