I am new to Razor Pages and I want to add a product to a list that is included in the PageModel and display the list in a table, but when adding a product to the list the section of the table is updated.
that is done by javascript
just refer to your elements where it says col 1
and col 2
is a simple example.
$('#add').on('click', function(){
html = '<tr><td>col 1</td>';
html += '<td>col 2</td></tr>';
$('tbody').append(html)
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button id="add">añadir nuevo</button>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
</tr>
</thead>
<tbody>
</tbody>
</table>