Introduction
Here, I introduce you to jQuery.datatable features in our web application in the .NET Core MVC Project.
The Model-View-Controller (MVC) architectural pattern separates an application into three main groups of components: Models, Views, and Controllers. This pattern helps to achieve separation of concerns. Using this pattern, user requests are routed to a Controller which is responsible for working with the Model to perform user actions and/or retrieve results of queries. The Controller chooses the View to display to the user and provides it with any Model data it requires.
Jquery. data tables help us to show the HTML table in a responsive and interactive way by adding Paging, Sorting, Export Events, and many more features and functionality on the client side.
In your existing .NET Core MVC project solution, you need to add client-side library packages for jQuery. data tables, which you can also download directly from here.
With Datatables, you can alter the ordering characteristics of the table at initialization time. Using the order initialization parameter, you can set the table to display the data in the exact order that you want.
Datatables can split the rows in tables into individual pages, which is an efficient method of showing a large number of records in a small space. The end-user is provided with controls to request the display of different data as they navigate through the data. This feature is enabled by default, but if you wish to disable it, you may do so with this parameter.

Here, I am using bundleconfig.json for bundling and minification where we register all required files as a single output file.
Before adding the bundleconfig.json file to your project's root directory, add an extension of Bundler and Minifier to your project.
or
You can also directly refer the all JS and CSS file directly to your Page or _Layout.cshtml.
bundleconfig.json
[
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/lib/jquery/dist/jquery.js",
"wwwroot/datatables/js/jquery.dataTables.js",
"wwwroot/datatables/js/dataTables.bootstrap.js",
"wwwroot/datatables/js/dataTables.bootstrap4.js",
"wwwroot/datatables/js/dataTables.dataTables.js",
"wwwroot/datatables/js/dataTables.foundation.js",
"wwwroot/datatables/js/dataTables.jqueryui.js",
"wwwroot/datatables/js/dataTables.material.js",
"wwwroot/datatables/js/dataTables.semanticui.js",
"wwwroot/datatables/js/dataTables.uikit.js",
"wwwroot/datatables/js/datatables-buttons/js/dataTables.buttons.js",
"wwwroot/datatables/js/datatables-buttons/js/buttons.colVis.js",
"wwwroot/datatables/js/datatables-buttons/js/buttons.flash.js",
"wwwroot/datatables/js/datatables-buttons/js/buttons.html5.js",
"wwwroot/datatables/js/datatables-buttons/js/buttons.print.js"
],
"minify": {
"enabled": true,
"renameLocals": true
}
},
{
"outputFileName": "wwwroot/js/site.min.css",
"inputFiles": [
"wwwroot/datatables/css/jquery.dataTables.css",
"wwwroot/datatables/css/dataTables.bootstrap.css",
"wwwroot/datatables/css/dataTables.bootstrap4.css",
"wwwroot/datatables/css/dataTables.foundation.css",
"wwwroot/datatables/css/dataTables.jqueryui.css",
"wwwroot/datatables/css/dataTables.material.css",
"wwwroot/datatables/css/dataTables.semanticui.css",
"wwwroot/datatables/css/dataTables.uikit.css",
"wwwroot/datatables/css/buttons.dataTables.min.css"
],
"minify": {
"enabled": true,
"renameLocals": true
}
}
]




Join the conversation! Your thoughts help the community grow.