Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

113
Vistas
Weird issue Ajax calls wrong aspx.cs file

I have a weird issue.

When I use Ajax to call a function in an aspx.cs file, the Ajax sends the request in the wrong aspx file even if I ask another file. In fact, every time I try it call the aspx.cs file of the first page.

this is my ajax :

    $.ajax({
        type: "POST",
        url: "NewLayerPage.aspx/getData2",
        data: dataToSend,
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            console.log(dataToSend);
            console.log("data sended");
        },
        failure: function (response) {
            alert(response.d);
        }
    });

When I use that code in a function, it is looking for "getData2" in "FirstPage.aspx.cs" instead of "NewLayerPage.aspx.cs". I'm sure my function in NewLayer work because when I copy/paste it in FirstPage I have no issue. This is my error :

Any ideas ? Thanks for all !

EDIT : So when I comment the function in "firstPage" I got an error as you can see here :

But if I do not comment the function I do not have an error:

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda