To implement the paging query result, you will create a View-Model to handle information about each page to be displayed. Then you will create a specific Controller and View to display the query result.
Note
Optionally, to make pagination elements look better, we will use Twitter Bootstrap
, which is a CSS and JavaScript framework that is used within HTML pages and provides advanced functionality to a website. You may ignore steps 6 and 7 if you don't want to implement Twitter Bootstrap
.
Open the
World
application, select theModels
folder and create a new folder and name itViewModels
.Right-click on the
ViewModels
folder, add a new class and name itPagedCountryList
.Modify the
PagedCountryList
class as follows:Create a new
Controller
class, select the Empty MVC Controller template, and name itPagedCountryController
.Make sure the
PagedCountryController
class inherits fromRavenBaseController
and modify it as follows: