我们正在使用ASP.NET Webforms和jqGrid。从Web服务到网格检索数据没有问题。但是,在尝试使用saveRow时,我们会遇到异常。我认为这是由于无效的json,但使用内置的saveRow()我会猜到网格会使它成为有效的json。使用fiddler2并且调用使用“application / json; charset = utf-8”
调用saveRow:
$("#SupplierSettingTable").jqGrid('saveRow', rowNumber, true, '<%= ResolveClientUrl("~/Services/SupplierSettingService.asmx/SetSupplierSettingItem")%>' );
以下是例外:
{"Message":"Invalid JSON primitive: AccountGroupName.","StackTrace":" at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)\r\n at System.Web.Script.Services.RestHandler.GetRawParamsFromPostRequest(HttpContext context, JavaScriptSerializer serializer)\r\n at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.ArgumentException"}
帮助表示赞赏......