Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. INDEX FOR MOVIE
  2.  
  3.  
  4. @*@model IEnumerable<ou3Movie.Models.Movie>*@
  5. @model PagedList.IPagedList<ou3Movie.Models.Movie>
  6. @using PagedList.Mvc;
  7. <link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
  8.  
  9.  
  10. @{
  11. ViewBag.Title = "Movies";
  12. }
  13.  
  14. <h2>Movies</h2>
  15.  
  16. <p>
  17. @Html.ActionLink("Create New", "Create")
  18. </p>
  19.  
  20. @using (Html.BeginForm("Index", "Movie", FormMethod.Get))
  21. {
  22. <p>
  23. Find by title, director or genre: @Html.TextBox("search", ViewBag.CurrentFilter as string)
  24. <input type="submit" value="search" />
  25. </p>
  26. }
  27. <table class="table">
  28. <tr>
  29. <th>
  30. @Html.ActionLink("Title", "Index", new { sortOrder = ViewBag.TitleSort, currentFilter = ViewBag.CurrentFilter })
  31. </th>
  32. <th>
  33. @Html.ActionLink("Director", "Index", new { sortOrder = ViewBag.DirectorSort, currentFilter = ViewBag.CurrentFilter })
  34. </th>
  35. <th>
  36. @Html.ActionLink("Genre", "Index", new { sortOrder = ViewBag.GenreSort, currentFilter = ViewBag.CurrentFilter })
  37. </th>
  38. <th></th>
  39. </tr>
  40.  
  41. @foreach (var item in Model)
  42. {
  43. <tr>
  44. <td>
  45. @Html.DisplayFor(modelItem => item.Title)
  46. </td>
  47. <td>
  48. @Html.DisplayFor(modelItem => item.Director)
  49. </td>
  50. <td>
  51. @Html.DisplayFor(modelItem => item.Genre)
  52. </td>
  53. <td>
  54. @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
  55. @Html.ActionLink("Details", "Details", new { id = item.ID }) |
  56. @Html.ActionLink("Delete", "Delete", new { id = item.ID })
  57. </td>
  58. </tr>
  59. }
  60.  
  61. </table>
  62.  
  63. <br />
  64. Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
  65.  
  66. @Html.PagedListPager(Model, page => Url.Action("Index",
  67. new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement