回覆列表
  • 1 # 使用者5379226960698

    新建建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;

    }

    });

  • 中秋節和大豐收的關聯?
  • 黑木耳能煮稀飯嗎?