Bootstrap provides a host of different HTML elements that are styled and ready to use. These elements include the following:
Tables
Buttons
Forms
Images
Bootstrap provides a default styling for HTML tables with a few options to customize their layout and behaviors. The default ASP.NET MVC scaffolding automatically adds the table
class names to the table
element when generating a list view.
To see this in action, complete the following steps:
Create a new view model class in our project's
Models
folder calledProductViewModel.cs
. This class will contain six properties and its code is listed as follows:public class ProductViewModel { public int ProductID { get; set; } public string ProductName { get; set; } public decimal? UnitPrice { get; set; } public int? UnitsInStock { get; set; } public bool Discontinued { get; set; } public string Status { get; set; } }
Next, we'll add a new empty
ProductsController
class and only add one action...