Advertisement
wingman007

2018_DotNetProgrammingPartTime_Index.cshtml

Sep 25th, 2018
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. @page
  2. @model IndexModel
  3. @{
  4.     ViewData["Title"] = "Home page";
  5. }
  6.  
  7. <h1>@Model.Message</h1>
  8.  
  9. <form method="post">
  10. <table class="table">
  11.     <thead>
  12.         <tr>
  13.             <th>Id</th>
  14.             <th>Name</th>
  15.             <th></th>
  16.         </tr>
  17.     </thead>
  18.     <tbody>
  19.         @foreach (Customer customer in Model.Customers)
  20.         {
  21.             <tr>
  22.                 <td>@customer.Id</td>
  23.                 <td>@customer.Name</td>
  24.                 <td>
  25.                     <a asp-page="./Edit" asp-route-id="@customer.Id">Edit</a>
  26.                     <button type="submit" asp-page-handler="delete" asp-route-id="@customer.Id">Delete</button>
  27.                 </td>
  28.             </tr>
  29.         }
  30.     </tbody>
  31. </table>
  32. </form>
  33. <a asp-page="./Create">Create</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement