尝试使用
data该
$.ajax功能的选项。更多信息在这里。
$('#btnSaveComments').click(function () { var comments = $('#txtComments').val(); var selectedId = $('#hdnSelectedId').val(); $.ajax({ url: '<%: Url.Action("SaveComments")%>', data: { 'id' : selectedId, 'comments' : comments }, type: "post", cache: false, success: function (savingStatus) { $("#hdnOrigComments").val($('#txtComments').val()); $('#lblCommentsNotification').text(savingStatus); }, error: function (xhr, ajaxOptions, thrownError) { $('#lblCommentsNotification').text("Error encountered while saving the comments."); } });});


