I want to move rows up and down in the table.
I would like to save the order of rows once I moved the items, so that next time I display the table again, the table will display the data from previous updated order.
This is my cshtml:
<table class="table">
<tr>
<th>
</th>
<th>
Item Description
</th>
<th>
Price
</th>
<th>
Quantity
</th>
<th>
Total Price
</th>
</tr>
@foreach(var item in Model.Items)
{
<tr>
<td>
<a href="#" class="up">Up</a>
<a href="#" class="down">Down</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.ItemDescription)
</td>
<td>
@Html.DisplayFor(modelItem => item.ItemPrice)
</td>
<td>
@Html.DisplayFor(modelItem => item.ItemQuantity)
</td>
<td>
@Html.DisplayFor(modelItem => item.ItemTotalPrice)
</td>
<td>
@Html.ActionLink("Edit", "Edit", "Items", new { id = item.ItemID},null) |
@Html.ActionLink("Delete", "Delete", "Items", new { id = item.ItemID }, null)
</td>
</tr>
}