2013-04-23 36 views
0

我使用ajax和web方法,当我执行此代码时出现错误thar说 POST POST 500(内部服务器错误) 但此路径存在!javascript post 500 serrver内部错误

这个代码是我使用在这一刻

function fnSendID() { 

     $.ajax({ 
      type: "POST", 
      url: "GMap.aspx/SendCommands", 
      data: '{IDMobile: "'+$("#<%=Ddl_MobileCustomer.ClientID%>").val()+'"}', 
      contentType: "application/json; charset=utf-8", 
      dataType: "json", 
      success: function (response) { 

       console.log("Entro : " + response.d); 
      }, 
      failure: function (response) { 
       console.log("Fallo : " + response.d); 
      } 
     }); 

<WebMethod()> _ 
    Public Shared Function SendCommands(ByVal IDMobile As String) As String 
     'iIDMobile = GetMobileID(iIDMobile) 
     Dim sResponse As String = IDMobile + "Buenas" 
     Return sResponse 
    End Function 

回答

1

一个500指的路径你打造成在服务器端的错误不在于路径不存在。

+0

POST http:// localhost:12289/GMap.aspx/SendCommands 500(内部服务器错误)此路径如果存在!!! – Deathshoo7 2013-04-23 20:55:33

0

调试代码并在Dim sResponse As String = IDMobile +“Buenas”中设置断点。 它到达这里吗?退货之前是否有任何异常?