:bootstrap adminlte教程6:文章管理页面改写因为有二个提交
才发现加了批量删除文章,以前的BUTTON的搜索肯定没效了,怎么嵌套都不行,只能分开写
@*@model IEnumerable<jsdhh2.Models.CmsContent>*@ @model PagedList.IPagedList<jsdhh2.Models.CmsContent> @using PagedList.Mvc; <link href="~/Content/PagedList.css" rel="stylesheet" /> @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_AdminLayout.cshtml"; } <!-- Content Header (Page header) --> <section class="content-header"> <h1> 文章管理 <small>分为超管和本人</small> </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li> <li class="active">Here</li> </ol> </section> <!--end Content Header (Page header) --> <!-- Main content --> <section class="content"> <div class="col-xs-12"> <div class=" "> <div class="panel panel-default"> <div class="panel-heading"> @using (Html.BeginForm("index", "CmsContents", new { @class = "form-inline" }, FormMethod.Post)) { <div class="form-inline"> <div class="form-group"> 请选择栏目: @Html.DropDownList("SeachColumnString", new SelectList(ViewBag.drolistmenu, "Value", "Text"), "请选择") </div> <div class="form-group"> <div class="input-group col-md-12"> @Html.TextBox("SearchString", "", new { @class = "form-control", @Style = "display:inline" }) <span class="input-group-btn "> <input id="btnSearch" class="btn btn btn-primary" type="submit" value="搜索"> </span> </div> </div> </div> } </div> </div> </div> @using (Html.BeginForm("DelCms", "CmsContents", new { @class = "form-inline" }, FormMethod.Post)) { <div class="panel-body"> <a class="btn btn-primary" href="/CmsContents/Create">新建</a> <input type="submit" class="btn btn-warning" value="删除" /> </div> <div class="box"> <div class="box-body table-responsive no-padding"> <table class="table"> <tr> <th> </th><th> 栏目ID </th> <th> 标题 </th> <th>创建时间 </th> <th> 创建者 </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.CheckBox(item.Id, false) </td> <td> @Html.DisplayFor(modelItem => item.ColumnId) </td> <td> @Html.DisplayFor(modelItem => item.Title) </td> <td> @Html.DisplayFor(modelItem => item.CreatTime, "DateTimeTemplate") </td> <td>@Html.DisplayFor(modelItem => item.CreatUser) </td> <td> @Html.ActionLink("修改", "Edit", new { id = item.Id }, new { @class = "btn btn-info" }) | @Html.ActionLink("阅读", "Details", new { id = item.Id }, new { @class = "btn btn-success" }) | @Html.ActionLink("删除", "Delete", new { id = item.Id }, new { @class = "btn btn-warning" }) </td> </tr> } </table> </div> </div><!-- /.box --> } <!-- Main content --> Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount @Html.PagedListPager(Model, page => Url.Action("Index", new { page, SeachColumnString = ViewBag.SeachColumnString, SearchString = ViewBag.SearchString })) </section>