asp.netajaxasp.net-ajaxextender

webmethod call issue withing asp.net ajax extender control


I have an extender control and want a call to webmethod from within it. but neither Sys.net.webserviceproxy.invoke nor $.ajax working. $.ajax issues server timed out error. invoke works but does not call the web method. the code is below

   [WebMethod]
public static string calculateTime(string dateTime) {

    return result;
}

the method in extender control that calls the 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);

},

Solution

  • I was using Path address as "CalculateTime.asmx". However, this is the case with asp.net. I am calling it from javascript so It should be "http://localhost:18194/applicationname/Calculate.asmx/calculateTime". It wasted a lot of my time.