$.ajax(
{
type: 'GET',
url: 'ProductOp.aspx/getProduct',
data: '1',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (msg) {
oldProduct = JSON.parse(msg.d);
}
});
[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public static string getProduct(string ID)
{
ProductOperations productOp = new ProductOperations();
ProductObject product = productOp.Read(Convert.ToInt32(JsonConvert.DeserializeObject(ID)));
return JsonConvert.SerializeObject(product);
}
给我
消息“无效的 Web 服务调用,参数缺失值:'ID'。” 堆栈跟踪
" konum: System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary`2 parameters) konum: System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters) konum: System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams) konum: System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)"
异常类型“System.InvalidOperationException”
先感谢您