.Net MVC 分页排序查询综合 - Controller+View
来源:互联网 发布:模糊算法有什么 编辑:程序博客网 时间:2024/04/30 11:50
Controller函数
public ActionResult Index()
{
var user = new SysUsers();
TryUpdateModel(user);
return View(user);
}
View页面
@model lktec.am7.Entity.SysUsers
@{ViewBag.Title = "系统用户管理";}
<h2>@ViewBag.Title</h2>
<div class="inner">
<p>@Html.ActionLink("注册新用户", "Register")</p>
@using(Html.BeginForm("Index","Account",FormMethod.Get))
{
<table>
<tr>
<td class="lbltitle">用户名/姓名</td>
<td>@Html.TextBoxFor(m=>m.UID)</td>
<td class="lbltitle">电话/手机</td>
<td>@Html.TextBoxFor(m => m.Phone)</td>
</tr>
<tr>
<td class="lbltitle">邮件</td>
<td>@Html.TextBoxFor(m => m.Email)</td>
<td class="lbltitle">部门</td>
<td>@Html.TextBoxFor(m => m.Department)</td>
</tr>
<tr>
<td class="lbltitle">状态</td>
<td>@Html.DropDownListFor(m => m.Status,Model.GetStatusSIL())</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="查找"/></td>
</tr>
</table>
}
<table>
<tr>
<th>@Html.ActionLink("编号", "Index", Model.RouteData("OrderBy", Model.NextOrderBy("ID")),new Dictionary<string,object>{ { "class","cls_"+Model.OrderByStatus("ID")}})</th>
<th>@Html.ActionLink("用户名", "Index", Model.RouteData("OrderBy", Model.NextOrderBy("UID")), new Dictionary<string,object>{ { "class", "cls_" + Model.OrderByStatus("UID") }})</th>
<th>@Html.ActionLink("姓名", "Index", Model.RouteData("OrderBy", Model.NextOrderBy("NickName")), new Dictionary<string,object>{ { "class", "cls_" + Model.OrderByStatus("NickName") }})</th>
<th>邮件</th>
<th>部门</th>
<th>电话</th>
<th>手机</th>
<th>用户状态</th>
<th>操作</th>
</tr>
@foreach (var item in Model.Items)
{
<tr>
<td>@Html.DisplayFor(modelItem => item.ID) </td>
<td>@Html.DisplayFor(modelItem => item.UID) </td>
<td>@Html.DisplayFor(modelItem => item.NickName) </td>
<td>@Html.DisplayFor(modelItem => item.Email) </td>
<td>@Html.DisplayFor(modelItem => item.Department) </td>
<td>@Html.DisplayFor(modelItem => item.Telephone) </td>
<td>@Html.DisplayFor(modelItem => item.Mobile) </td>
<td>@lktec.am7.Util.EnumFunc.GetCommonStatusName(item.Status) </td>
<td>
@Html.ActionLink("编辑", "Edit", new { id = item.ID })
@Html.ActionLink("设置角色", "Roles", new { id = item.ID })
@Html.ActionLink("查看", "Details", new { id = item.ID })
</td>
</tr>
}
</table>
@for (var p = 0; p < Model.PageCount; p++)
{
if (p == Model.CurrentPageIndex)
{
<span>@(p + 1)</span>
}
else
{
@Html.ActionLink("第" + (p + 1) + "页", "Index", Model.RouteData("CurrentPageIndex", p));
}
}
</div>
- .Net MVC 分页排序查询综合 - Controller+View
- .NET MVC 查询分页排序综合类 - 基类
- .Net MVC 分页排序查询综合 - 系统用户类
- Model-View-Controller (MVC)
- mvc:view-controller
- Model View Controller(MVC)
- springmvc <mvc:view-controller >
- mvc:view-controller
- Model-View-Controller(mvc)
- mvc:view-controller
- mvc:view-controller
- <mvc:view-controller 用法
- mvc:view-controller 用法
- mvc(model view controller)
- MVC(Model-View-Controller)
- mvc:view-controller
- springMVC <mvc:view-controller />
- mvc:view-controller
- Android Intent 用法全面总结
- ant 打包
- Linux音频编程2 音频录放框架
- 第四周实验报告 任务一
- MYSQL引擎
- .Net MVC 分页排序查询综合 - Controller+View
- 选择所有checkbox
- 第四周实验报告 任务三
- 遍历,当前对象为第几个
- PHP高效率写法(详解原因)
- 第六周任务4:三角形“类”的新做法
- ALSA声音编程介绍(译文)
- ATL布幔之下的秘密(1)
- PHP数组实际占用内存大小的分析