Ajax grid
MVC controller

[HttpGet]
public ViewResult Index()
{
    // Only browser url query values will be visible here.
    return View();
}

[HttpGet]
public PartialViewResult IndexGrid()
{
    // Only grid query values will be available here.
    return PartialView("_IndexGrid", repository.GetPeople());
}

MVC main view

@Html.AjaxGrid(Url.Action("IndexGrid"))

// or with html attributes

@Html.AjaxGrid(Url.Action("IndexGrid"), new { id = "my-ajax-grid"})

_IndexGrid partial view

@model IEnumerable<Person>

@* Should only include grid declaration *@

@(Html
    .Grid(Model)
    .Build(columns =>
    {
        columns.Add(model => model.Name).Titled("Name");
        columns.Add(model => model.Surname).Titled("Surname");
        columns.Add(model => model.MaritalStatus).Titled("Marital status");

        columns.Add(model => model.Age).Titled("Age");
        columns.Add(model => model.Birthday).Titled("Birthday").Formatted("{0:d}");
        columns.Add(model => model.IsWorking).Titled("Employed");
    })
    .Empty("No data found")
    .Id("my-ajax-grid")
    .Pageable(pager =>
    {
        pager.PagesToDisplay = 2;
        pager.RowsPerPage = 2;
    })
    .Filterable()
    .Sortable()
)

Razor pages

public class IndexModel : PageModel
{
    public void OnGet()
    {
    }
}

public class IndexGridModel : PageModel
{
    public IQueryable<Person> People { get; set; }

    public void OnGet()
    {
        People = repository.GetPeople();
    }
}

Index razor page

@page
@model IndexModel

@Html.AjaxGrid(Url.Page("IndexGrid"))

// or with html attributes

@Html.AjaxGrid(Url.Page("IndexGrid"), new { id = "my-ajax-grid"})

IndexGrid razor page

@page
@model IndexGridModel

@{ Layout = null; }

@* Should only include grid declaration *@

@(Html
    .Grid(Model.People)
    .Build(columns =>
    {
        columns.Add(model => model.Name).Titled("Name");
        columns.Add(model => model.Surname).Titled("Surname");
        columns.Add(model => model.MaritalStatus).Titled("Marital status");

        columns.Add(model => model.Age).Titled("Age");
        columns.Add(model => model.Birthday).Titled("Birthday").Formatted("{0:d}");
        columns.Add(model => model.IsWorking).Titled("Employed");
    })
    .Empty("No data found")
    .Id("my-ajax-grid")
    .Pageable(pager =>
    {
        pager.PagesToDisplay = 2;
        pager.RowsPerPage = 2;
    })
    .Filterable()
    .Sortable()
)