Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
¿Por qué mi WebMethod no se llama desde javascript?

Estoy trabajando en ASP.Net 4. Tengo lo siguiente dentro de la etiqueta del cuerpo de mi aspx:

 <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server"/> <script type="text/javascript"> function Process() { var CHK = document.getElementById("<%=lstAffEmployees.ClientID%>"); var checkbox = CHK.getElementsByTagName("input"); var counter = 0; for (var i = 0; i < checkbox.length; i++) { if (checkbox[i].checked) { counter++; var Attorney = label[i].innerHTML; var cutoff = Attorney.indexOf('['); var cAttorney = Attorney.substring(0, cutoff - 1); PageMethods.saveData(checkbox[i].value, cAttorney); } } return true; } </script>

En mi código subyacente, tengo:

 [WebMethod] public static void saveData(string attyNo, string attyName) { //mycode }

En la depuración, llego a la llamada de PageMethods en el javascript, pero nunca se llama a saveData en mi código subyacente. No entiendo por qué no. ¿Alguien puede ayudar?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!