제가 누락 된 부분을 알아낼 수 없으므로 IIS 설정을 변경해야합니까? 다음과 같이500 내부 오류 jQuery 웹 메서드 호출 - IIS 5.1 (: -/yea i know ...)
$(document).ready(function() {
function AjaxSuccess(result) {
alert('result: ' + result);
}
function AjaxError(result) {
alert("error");
alert(result.status + ' ' + result.statusText);
}
$(".hlp").click(function() {
var myVal= $(this).val();
var id = $(this).attr('id');
$.ajax({
type: "POST",
url: "AjaxWebMethods.aspx/GetHelpText",
contentType: "application/json; charset=utf-8",
data: "{'helpText' : '" + id + "'}",
dataType: "json",
success: AjaxSuccess,
error: AjaxError
});
});
});
내 웹 방법은 다음과 같습니다
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class AjaxWebMethods : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e){ }
#region Exposed WebMethods
[System.Web.Services.WebMethod()]
public string GetHelpText(string helpItem)
{
string helpText = "testing web method";
return helpText;
}
#endregion
}
내가 2 개 팝 업 "오류" 다음 (501) 오류가 계속. 제발 이해해주세요. 의 WebMethod은 매개 변수의 이름으로 helpItem
복용으로
감사합니다. 업데이트되었지만 여전히 동일한 것을 얻고 있습니다. ( –
@ MadamZuZu - 업데이트를 확인하십시오 .. –