0
我有一個HTM頁面和一個service.aspx和service.aspx.cs文件在我當前的應用程序。我正在使用.Net 4.0。在service.aspx.cs頁面我有testmethod如下。Jquery ajax沒有打到服務器
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]
public static string test()
{
return "AA";
}
在我的HTML頁面
$.ajax({
type: "GET",
cache: false,
url: "NextGenFormService.aspx/test",
dataType: "xml",
contentType: "text/html",
success: AjaxSucceeded,
error: AjaxFailed
}); //end of $.ajax;
如果我繼續在我的服務器一個破發點但不打。 AjaxSucceeded被調用200 OK並且responseText爲空。
同樣適用於contenttype:application/json,數據類型:json。
我想從服務器或測試方法發送什麼,只不過是HTML和JavaScript。
已經在瀏覽器中檢查您的網址是它的工作? –
嘗試安裝Fiddler2來監控您的請求。它對這個請求說了什麼? – Tdelang
小提琴手的迴應即將消失。 – Shiras