标签:ons 100% bag 编号 name for get int led
@model List<Model.stuclass>
<table style="width:100%;">
<tr>
<td> 学生编号</td>
<td> 学生姓名</td>
<td> 学生性别</td>
<td> 学生年龄</td>
<td> 入学时间</td>
<td> 截至时间</td>
<td> 班级编号</td>
<td> 操作</td>
</tr>
@foreach (var item in Model)
{
<tr>
<td> @item.StuID</td>
<td> @item.StuName</td>
<td> @(item.StuSex?"男":"女")</td>
<td> @item.StuAge</td>
<td> @item.StuKTime</td>
<td> @item.StuJTime</td>
<td> @item.StuCLassID</td>
<td>
@Ajax.ActionLink("删除","delete",new{id=@item.StuID },new AjaxOptions {UpdateTargetId= "divTask" })
@Html.ActionLink("修改","UPD",new {id=@item.StuID })
</td>
</tr>
}
@*pagination分页,pagination-large 大小,pagination-centered 居中*@
<div class="pagination pagination-large pagination-centered">
<ul>
@{
int pageindex = ViewBag.PageIndex;//当前页
int sumpage = ViewBag.SumPage;//共多少页
if (pageindex <= 1)
{
<li class="disabled"><span>首页</span></li>@*禁用*@
<li class="disabled"><span>«</span></li>@*禁用*@
}
else
{
<li><a href="#" onclick="Pages(@(1))">首页</a></li>
<li><a href="#" onclick="Pages(@(pageindex - 1))">«</a></li>
}
int n = 4;//分页显示多少个分页格子
int index = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(pageindex) / n));
for (int i = 1; i <= n; i++)//遍历显示分页格子
{
int NPage = (index - 1) * n + i;//要显示的li
if (NPage <= sumpage)
{
<li class="active"><a href="#" onclick="Pages(@(NPage))">@(NPage)</a></li>
}
else
{
<li><a href="#" onclick="Pages(@(NPage))">@(NPage)</a></li>
}
}
if (pageindex >= sumpage)
{ <li class="disabled"><span>»</span></li>@*禁用*@
<li class="disabled"><span>尾页</span></li>@*禁用*@
}
else
{
<li><a href="#" onclick="Pages(@(pageindex+1))">»</a></li>
<li><a href="#" onclick="Pages(@(sumpage))">尾页</a></li>
}
</ul>
</div>
<p class="text-center">共 @(ViewBag.SumPage) 页,当前为第 @(ViewBag.PageIndex) 页</p>
<script>
function Pages(index) {
$.ajax({
url: "/view/Page",
type: "post",
data: { index: index, name: $("#txtName").val() },
success: function (data) {
$("#divTask").empty().append(data);
}
})
}
</script>
标签:ons 100% bag 编号 name for get int led
原文地址:https://www.cnblogs.com/fsl123/p/9387557.html