ASP.NET jQuery error: Unknown Web Method

后端 未结 3 1172
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-20 10:56

This is my first time attempting to call an ASP.NET page method from jQuery. I am getting a status 500 error with the responseText message that the web method cannot be foun

相关标签:
3条回答
  • 2020-12-20 11:32

    Your web method needs to be public and static.

    0 讨论(0)
  • 2020-12-20 11:35

    Clean the solution and rebuild. I've seen webmethods throw 500's until you do this.

    0 讨论(0)
  • 2020-12-20 11:37

    Add public static before your method...

    ex.

    [WebMethod]
    public static string MethodName() {}  
    
    0 讨论(0)
提交回复
热议问题