Skip to content

Instantly share code, notes, and snippets.

@oclockvn
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oclockvn/6ec002c0dfb68cc670a9 to your computer and use it in GitHub Desktop.
Save oclockvn/6ec002c0dfb68cc670a9 to your computer and use it in GitHub Desktop.
@using BootstrapModalExample.Models
@model IEnumerable<Item>
@{
ViewBag.Title = "Index";
int i = 1;
}
<h2>Index</h2>
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Item</th>
<th>Price</th>
<th>
<a href='/EStore/Add' class='pull-right btn btn-info btn-add'>Add New Item</a>
<!-- nên sử dụng cách viết dưới đây -->
@*<a href='@Url.Action("Add","EStore")' class="pull-right btn btn-info btn-add" >Add New Item</button>*@
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@(i++)</td>
<td>@item.Name</td>
<td>@item.Price</td>
<td>
<div class="pull-right">
<a href='/EStore/Update/@item.Id' class='btn btn-primary btn-update'><i class="glyphicon glyphicon-pencil"></i></a>
<a href='/EStore/ConfirmDelete/@item.Id' class='btn btn-primary btn-delete'><i class="glyphicon glyphicon-trash"></i></a>
<!-- nên sử dụng cách viết dưới đây -->
@*
<a href='@Url.Action("Update", "EStore", routeValues: new { id=item.Id})' class="btn btn-primary btn-update"><i class="glyphicon glyphicon-pencil"></i></a>
<a href='@Url.Action("ConfirmDelete", "EStore", routeValues: new { id=item.Id})' class="btn btn-danger btn-delete"><i class="glyphicon glyphicon-trash"></i></a>
*@
</div>
</td>
</tr>
}
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment