尋呼

2011-10-27 62 views
4

所以使用EF4我創建了一個腳手架控制器/視圖腳手架視圖MVC3,所以我的問題是我怎麼能添加分頁我的看法中容易/快速的方式? 的 控制器產生尋呼

public ViewResult Index() 
     { 
      return View(db.Perifericos.ToList()); 
     } 

觀點:產生

@model IEnumerable<Paginacion.Models.Perifericos> 

<p> 
    @Html.ActionLink("Create New", "Create") 
</p> 
<table> 
    <tr> 
     <th> 
      Nombre 
     </th> 
     <th> 
      Modelo 
     </th> 
    </tr> 

@foreach (var item in Model) { 
    <tr> 
     <td> 
      @Html.DisplayFor(modelItem => item.Nombre) 
     </td> 
     <td> 
      @Html.DisplayFor(modelItem => item.Modelo) 
     </td> 
     <td> 
      @Html.ActionLink("Edit", "Edit", new { id=item.idPerifericos }) | 
      @Html.ActionLink("Delete", "Delete", new { id=item.idPerifericos }) 
     </td> 
    </tr> 
} 
</table> 

回答