Loading and displaying data in jQuery DataTables
In order to implement the jQuery DataTables
plugin, you'll first need to create a new view that will list data inside an HTML table. For this example, you'll create a view that displays a list of customers. The list can be read from any data source, such as a SQL Server database. In this example, a simple List object will be used.
To accomplish this, complete the following steps:
In Visual Studio, add a new controller class called
CustomerController.cs
to theControllers
folder.Add a new folder called
Models
to the root of your project and add a new class calledCustomer.cs
to it.The
Customer
class will be used to retrieve a list of sample customer records. The code for the class is as follows:public class Customer { public string CustomerCode { get; set; } public string CompanyName { get; set; } public string ContactName { get; set; } public string...