回覆列表
  • 1 # 使用者906383263912

    新建建Web服務頁面(*.asmx)

    函式如下:

    [WebMethod]

    public string HelloWorld()

    {

    return "Hello World";

    }

    js呼叫如下:

    $.ajax({

    type: "POST",

    url: "/Webservice/test.asmx/HelloWorld",

    data: "{"Product_ID":"" + ProductID + ""}",

    contentType: "application/json; charset=utf-8",

    dataType: "json",

    success: function (msg) {

    try {

    //do something

    } catch (e) {

    }

    },

    error: function () {

    return false;

    }

    });

  • 中秋節和大豐收的關聯?
  • 八類重大刑事犯罪是什麼?