Advertisement
Guest User

SAMO DATATABLES

a guest
Jan 26th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.43 KB | None | 0 0
  1. @model IEnumerable<Cinema.Models.CinemaRoom>
  2.  
  3. @{
  4.     ViewBag.Title = "Index";
  5. }
  6.  
  7. <h2>Index</h2>
  8.  
  9. <p>
  10.     @Html.ActionLink("Create New", "Create")
  11. </p>
  12. <table class="table" id="rooms">
  13.     <thead>
  14.         <tr>
  15.             <th>
  16.                 @Html.DisplayNameFor(model => model.Name)
  17.             </th>
  18.             <th>
  19.                 @Html.DisplayNameFor(model => model.Number)
  20.             </th>
  21.             <th>
  22.                 @Html.DisplayNameFor(model => model.Is3D)
  23.             </th>
  24.             <th></th>
  25.         </tr>
  26.     </thead>
  27.  
  28.     <tbody>
  29.         @foreach (var item in Model)
  30.         {
  31.             <tr>
  32.                 <td>
  33.                     @Html.DisplayFor(modelItem => item.Name)
  34.                 </td>
  35.                 <td>
  36.                     @Html.DisplayFor(modelItem => item.Number)
  37.                 </td>
  38.                 <td>
  39.                     @Html.DisplayFor(modelItem => item.Is3D)
  40.                 </td>
  41.                 <td>
  42.                     @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
  43.                     @Html.ActionLink("Details", "Details", new { id = item.Id }) |
  44.                     @Html.ActionLink("Delete", "Delete", new { id = item.Id })
  45.                 </td>
  46.             </tr>
  47.         }
  48.  
  49.     </tbody>
  50.  
  51. </table>
  52.  
  53. @section scripts {
  54.     <script>
  55.         $(document).ready(function () {
  56.             $("#rooms").dataTable();
  57.         });
  58.     </script>
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement