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

210
Vistas
Why in dataTable information is read from the database, But they are not displayed in the dataTable

dataTable information is read from the database, But they are not displayed in the dataTable I use inspect to see the information, but the table is not displayed at all What's wrong? The code is as follows

public PartialViewResult OnGetViewAllPartial()
{
    lstLevel =  _CourseLevelApplication.GetCourseLevelForDisplay();
    return new PartialViewResult
    {
        ViewName = "_ViewAll",
        ViewData = new ViewDataDictionary<IEnumerable<CoursLevelViewModel>>(ViewData, lstLevel)      
    };
}


   <table id="datatable" class="table table-striped table-bordered" >
                        <thead>
                            <tr>
                                <th>#</th>                                  
                                <th>title</th>                         
                                <th>action</th>
                                
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model)
                            {
                                <tr>                                             
                                    <td>@item.Id</td>
                                    <td>@item.Title</td> 
        
                                    <td>
                                      <a onclick="jQueryModalGet('?handler=CreateOrEdit&id=@item.Id','Edit level')" class="btn btn-info text-white"> Edit</a>
                                    <form method="post" asp-page="Index" asp-route-id="@item.Id" asp-page-handler="Delete" onsubmit="return jQueryModalDelete(this)" class="d-inline">
                                        <button type="submit" class="btn btn-danger text-white"> Delete</button>
                                    </form>
                                        
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>

@section Scripts {
<script src="~/AdminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/AdminTheme/assets/datatables/dataTables.bootstrap.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $('#datatable').dataTable();
    });

</script>

}

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try putting these into the head section into the layout page.

<script src="~/AdminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/AdminTheme/assets/datatables/dataTables.bootstrap.js"></script>
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