-
Notifications
You must be signed in to change notification settings - Fork 3
/
Custom.cshtml
42 lines (33 loc) · 1.33 KB
/
Custom.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@model IEnumerable<X.PagedList.Mvc.Bootstrap4.SampleData.SampleModel>
@using X.PagedList
@using X.PagedList.Mvc.Bootstrap4.Core
@using X.PagedList.Mvc.Core
@{
}
<h2>Custom - IfNeeded</h2>
<hr />
<partial name="_LinkPartial"/>
<hr />
<div class="">
<form class="d-inline" asp-action="Custom" asp-controller="Home" method="get">
Query name: <input type="text" value="@Context.Request.Query["name"]" name="name" style="display: inline; max-width: 280px;" class="form-control" />
<button class="btn btn-primary" type="submit">Search</button>
</form>
</div>
@Html.PagedListPager((IPagedList)Model, page => Url.Action("Custom", new { page, name = Context.Request.Query["name"] }), new PagedListRenderOptions() { Display = PagedListDisplayMode.IfNeeded }.ApplyBootstrap4Style())
<table class="table table-hover table-striped">
<tr>
<th>OrderId</th>
<th>Name</th>
<th>ContactTimes</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>@item.OrderId</td>
<td>@item.Name</td>
<td>@item.ContactTimes</td>
</tr>
}
</table>
@Html.PagedListPager((IPagedList)Model, page => Url.Action("Custom", new { page, name = Context.Request.Query["name"] }), new PagedListRenderOptions() { Display = PagedListDisplayMode.IfNeeded }.ApplyBootstrap4Style())