GetInfo为后台服务
[WebMethod]
public string GetInfo(string id)
{
try
{
return json;
}
catch { return null; }
}
//读值 function initValue() { var xhrArgs = { url: "../../Services.asmx/GetInfo",handleAs: "json",headers: { "Content-Type": "application/json" },postData: dojo.toJson({ "id": 1}),load: function (respone) { ShowValue(respone); },error: function (error) { alert("初始化值:" + error.message); } }; dojo.xhrPost(xhrArgs); }
原文链接:https://www.f2er.com/dojo/291358.html