簡體   English   中英

當 aspx web 方法具有超過 8 個參數時無法訪問 jquery ajax 調用

[英]not able to access when aspx web method having more than 8 parameters from jquery ajax call

我的 aspx web 方法有 10 個參數。 當 aspx web 方法具有來自 jquery ajax 調用的超過 8 個參數時,我無法訪問。 8個參數方法可以無錯誤地訪問。 唯一的問題是調用這 10 個參數的方法時。我收到 500 個內部錯誤。

我的 Ajax 電話:

var updatedata = '{slNo: "' + GsSlNo + '", oldCategoryName: "' + GsItemCategory + '", newCategoryName:"' + $('#ddlCategoryName').val() + '", itemName: "' +
                   $('#txtItemName').val() + '", modelNo: "' + $('#txtModelNo').val() + '", stockQty: "' + $('#txtStockQty').val() + '", description: "' +
                   $('#txtDescription').val() + '", imageString: "' + imgData + '", fileName: "' + sFileName + ', oldImagePath:"' + GsItemImagePath + '"}';

            $.ajax({
                type: "POST",
                url: "sitesettings.aspx/UpdateItemMaster",
                data: updatedata,
                async: false,
                contentType: "application/json; charset=utf-8",
                dataType: "json",

我的 aspx 網絡方法

[System.Web.Services.WebMethod]
    public static long UpdateItemMaster(string slNo, string oldCategoryName, string newCategoryName, string itemName, string modelNo, string stockQty, string description, 
                                        string imageString, string fileName, string oldImagePath)

像這樣改變數組。

var params = new Object();
params.slNo = GsSlNo;
params.oldCategoryName = GsItemCategory;
.
.
.
params.stockQty= $('#txtStockQty').val();

 $.ajax({
                type: "POST",
                url: "sitesettings.aspx/UpdateItemMaster",
                data: data:JSON.stringify(params),
                async: false,
                contentType: "application/json; charset=utf-8",
                dataType: "json",

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM