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

163
Vistas
Why the JavaScript load function is not loaded?

I work with Asp.net core Razor Page. I want JavaScript to load when the page loads, run when the page loads,no error is displayed on the console, my question is, did I pass the input parameters of the load function correctly?

public IActionResult OnGetShowComment(long id,int pageId=1 )
 {
  Comments=_CourseQuery.GetComment(User.Identity.Name,id,pageId);        
  return Partial("ShowComment",Comments);      
 }

JavaScript code:

$(function() {                     
$("#listComment").load("/Course/ShowCourse?handler=ShowComment" + 
@Model.ShowCourse.Id);     
});
     
    
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you want to pass @Model.ShowCourse.Id to OnGetShowComment in url,You need to use "/Course/ShowCourse?handler=ShowComment&&id=" + @Model.ShowCourse.Id,or it will call a handler which name is ShowComment" + @Model.ShowCourse.Id with "/Course/ShowCourse?handler=ShowComment" + @Model.ShowCourse.Id.Change your js like this:

$(function() {                     
$("#listComment").load("/Course/ShowCourse?handler=ShowComment&&id=" + 
@Model.ShowCourse.Id);     
});
about 4 years ago · Juan Pablo Isaza Denunciar
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