In this article I am going to explain how to change page
size with dropdown in asp.net MVC.
Description:
I am using Pagedlist.mvc package for pagination. In previous
article I have explained . Now I want to change/set page size using
dropdown in foreach loop.
Implementation:
I want to display list of employees.
Model (Employee.cs)
public partial class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public Nullable<int> Phone { get; set; }
public Nullable<int> Salary { get; set; }
public string Department { get; set; }
public string ImagePath { get; set; }
public string EmailId { get; set; }
}
Add
controller
Now add an empty controller to project. Create action to
fetch the data.
Complete code of controller