Debian Codegraph @

examples/prism-cshtml.html

raw symbols SCIP
1 <h2>Full example</h2>
2 <pre><code>@* Source: https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-5.0&amp;tabs=visual-studio#the-home-page *@
3
4 @page
5 @model RazorPagesContacts.Pages.Customers.IndexModel
6 @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
7
8 &lt;h1>Contacts home page&lt;/h1>
9 &lt;form method="post">
10 &lt;table class="table">
11 &lt;thead>
12 &lt;tr>
13 &lt;th>ID&lt;/th>
14 &lt;th>Name&lt;/th>
15 &lt;th>&lt;/th>
16 &lt;/tr>
17 &lt;/thead>
18 &lt;tbody>
19 @foreach (var contact in Model.Customer)
20 {
21 &lt;tr>
22 &lt;td> @contact.Id &lt;/td>
23 &lt;td>@contact.Name&lt;/td>
24 &lt;td>
25 &lt;a asp-page="./Edit" asp-route-id="@contact.Id">Edit&lt;/a> |
26 &lt;button type="submit" asp-page-handler="delete"
27 asp-route-id="@contact.Id">delete
28 &lt;/button>
29 &lt;/td>
30 &lt;/tr>
31 }
32 &lt;/tbody>
33 &lt;/table>
34 &lt;a asp-page="Create">Create New&lt;/a>
35 &lt;/form>
36 </code></pre>