2013-04-23 37 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」中設置斷點。 它到達這裏嗎?退貨之前是否有任何異常?