How to call c# method with no parameters and access returned data?

后端 未结 2 1256
醉梦人生
醉梦人生 2021-01-22 16:08

So I have seen many examples such as these : https://stackoverflow.com/a/8094230/2525507

public class WebService : System.Web.Services.WebService {
   [WebMetho         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-22 16:15

    If your method takes no arguments, just don't specify the data property on the ajax call

    
    

    Also I could be wrong, but the WebService method you showed, doesn't look like it will return json. I think you will have to serialize, or set the content type or something similar. (Been along time since I've used the asmx type services)

提交回复
热议问题