AJAX to web method not returning JSON

后端 未结 4 460
-上瘾入骨i
-上瘾入骨i 2021-01-25 05:35

I am calling a web method in aspx page from my js file using AJAX. I have set the method to be [WebMethod] and the page inherits from System.Web.Ui.Page class. Still it does not

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-25 06:11

    Use Static String.

        [WebMethod]
        public static string CustomOrderService(string id)
        {
            string result;
            // code logic which sets the result value
            result="some value";
    
            return result;
        }
    

提交回复
热议问题