Ajax调用:无效的Web服务调用,缺少参数'itemTypes'的值]] << [

问题描述 投票:1回答:1
我创建了一个ajax调用,试图将一个对象作为参数发送到服务器,但是出现以下错误:

Invalid web service call, missing value for parameter: 'itemTypes'

我已经在javascript中检查了itemTypes变量,它包含期望值:

sessionStorage.itemTypeUid = "18"

sessionStorage.itemTypeName = "GRIT_SALT_BINS"

args = {CurId: 18, BaseTableName: "GRIT_SALT_BINS"}

javascript:

var itemTypes = { CurId: parseInt(sessionStorage.itemTypeUid), BaseTableName: sessionStorage.itemTypeName }; aj("DeleteItem", itemTypes);

Ajax:

function aj(funcName, args) { retval = $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: 'ItemEdit.asmx/' + funcName, data: JSON.stringify(args), dataType: "json", error: function (a, b, c) { var errors = a + b + c } }); }

VB:

<WebMethod()> Public Sub DeleteItem(itemTypes As Object) Dim CurId = "" Dim BaseTableName = "" actions.DeleteItem(CurId, BaseTableName) End Sub
我创建了一个ajax调用,并尝试将对象作为参数发送给服务器,但是出现以下错误:无效的Web服务调用,缺少参数值:'itemTypes'I ...
javascript asp.net ajax vb.net webmethod
1个回答
1
投票
您可以像这样更新您的网络方法:
© www.soinside.com 2019 - 2024. All rights reserved.