Advertisement
Guest User

Untitled

a guest
May 24th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. @model List<Post>
  2. @if(Model.Count==0)
  3. {
  4. <h1> No Posts</h1>
  5. }
  6. else
  7. {
  8. <h1> @Model.Count Posts</h1>
  9. <table class="table">
  10. <thead class="thead-dark">
  11. <tr>
  12. <th scope="col"> Id </th>
  13. <th scope="col">Title</th>
  14. <th scope="col">DEscription</th>
  15. <th scope="col">Created</th>
  16. <th colspan ="2">Manage</th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20.  
  21. @foreach (var x in Model)
  22. {
  23.  
  24. <tr>
  25. <th scope="row">@x.Id</th>
  26. <td>@x.Title</td>
  27. <td>@x.Description</td>
  28. <td>@x.CreatedAt</td>
  29. <td><a asp-action="Edit" asp-controller="Admin" asp-route-id="@x.Id">Edit</a></td>
  30. <td><a asp-action="Delete" asp-controller="Admin" asp-route-id="@x.Id">Delete</a></td>
  31. </tr>
  32. }
  33.  
  34.  
  35. </tbody>
  36. </table>
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement