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

206
Views
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 answers
Answer question

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 Report
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!