我从数据库中获取大量行。每行都与模型的一个对象相关联。所以现在,多亏了强类型视图,我正在传递这样的对象列表:
public PartialViewResult ListerIncidentsHotline()
{
int NumDossier = StructureData.DonneNumDossier((string)Session["Utilisateur"], (string)Session["MotDePasse"]);
List<IncidentHotline> ListeIncidents = StructureData.DonneIncidentsHotline(NumDossier, 10);
int NbreIncidents = StructureData.DonneNombreIncidents(NumDossier);
ViewBag.NombreIncidents = NbreIncidents;
return this.PartialView(ListeIncidents);
}
因此,在视图中,我正在显示一个包含以下数据的表格:
<table id="tabIncident" class="table table-striped">
<th>IdIncident</th><th>Libelle</th><th>Motif</th><th>Nom du responsable</th><th>Date de création</th><th>Date de clôture</th>
@foreach (var Incident in Model)
{
<tr><td>@Incident.IdIncident</td><td>@Incident.LibelleIncident</td><td>@Incident.MotifIncident</td><td>@Incident.NomResponsable</td><td>@Incident.DateCreation</td><td>@Incident.DateCloture</td></tr>
}
</table>
但是现在我想在表格中显示其中的 10 行,然后通过单击一个按钮来显示接下来的 10 行。有人有想法吗?