Last active
August 29, 2015 14:18
-
-
Save oclockvn/6ec002c0dfb68cc670a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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