我有一個擴展控件,並希望從它內部調用webmethod。但是既沒有Sys.net.webserviceproxy.invoke也沒有$ .ajax工作。 $ .ajax問題服務器超時錯誤。調用工程,但不調用Web方法。代碼如下webmethod調用與asp.net ajax擴展控件的問題
[WebMethod]
public static string calculateTime(string dateTime) {
return result;
}
在調用webmethod的擴展控件中的方法。
timer: function(){
Sys.Net.WebServiceProxy.invoke("CaculateTime.asmx", "calculateTime",false,{"dateTime":""+this._timestamp+""}, function (result, e){ this.get_element().innerText=result ;}, function(result, e){},"User Context", 100);
},