显示视图

@using Webdiyer.WebControls.Mvc;
@model PagedList<MODEL.biao>
@{
Layout = null;
}

<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="~/scripts/jquery-1.10.2.js"></script>
<script src="~/scripts/jquery.validate.unobtrusive.js"></script>
<script src="~/scripts/jquery.unobtrusive-ajax.js"></script>
<script src="~/scripts/jquery.form.js"></script>
<link href="~/scripts/bootstrap.css" rel="stylesheet" />
<script src="~/Scripts/MvcPager.js"></script>
</head>
<body>
@using (Html.BeginForm(new AjaxOptions() { UpdateTargetId = "div1" }))
{
<input id="Text1" type="text" name="bname" />
@Html.DropDownList("lid", ViewBag.s as List<SelectListItem>, "--请选择--")
<input id="Submit1" type="submit" value="查询" />
<input id="Button1" type="button" value="添加" οnclick="location.href = '/Index/Create/'" />
}
<div id="div1">
<table style="width:100%;">
<tr>
<td>编号</td>
<td>姓名</td>
<td>年龄</td>
<td>父母姓名</td>
<td>编辑</td>
</tr>
@foreach (var item in Model)
{
<tr>
<td>@item.bid</td>
<td>@item.bname</td>
<td>@item.age</td>
<td>@item.lid</td>
<td>
@Html.ActionLink("删除", "del", new { id = item.bid })
@Html.ActionLink("修改", "upt", new { id = item.bid })
</td>
</tr>
}
</table>
</div>
<div class="text-center">

@Ajax.Pager(Model, new PagerOptions
{
/*
* 设置分页显示的样式
*/

FirstPageText = "首页",
LastPageText = "最后一页",
NextPageText = "下一页",
PrevPageText = "上一页",
PageIndexParameterName = "index",
ContainerTagName = "ul",
CssClass = "pagination",
CurrentPagerItemTemplate = "<li class=\"active\"><a href=\"#\">{0}</a></li>",
DisabledPagerItemTemplate = "<li class=\"disabled\"><a>{0}</a></li>",
PagerItemTemplate = "<li>{0}</li>"
},
new MvcAjaxOptions
{
HttpMethod = "post",
UpdateTargetId = "div1",//更新数据的标签ID
DataFormId = "form0" //分页对应的条件搜索表单ID
})
<span style="display:inline-block; position:relative;top:30px;">共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录,当前为第 @Model.CurrentPageIndex 页</span>
</div>
</body>
</html>

转载于:https://www.cnblogs.com/JXSBoKeYuan/p/9388499.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值