日期:2014-05-17 浏览次数:20448 次
@using(Html.BeginForm()){ <tr> <td class="style2" valign="middle"> 查询条件 </td> <td class="style1" valign="middle"> <div style="line-height:25px;float:left"> 地市 :@Html.CheckBoxLists("P000", ViewBag.DS as IEnumerable<SelectListItem>, null)<br /> 地市 :@Html.CheckBoxLists("P001",ViewBag.PP as IEnumerable<SelectListItem>,null) </div> <div style="line-height:50px;float:left;margin-left:20px"> 来电原因 : <input id="P002" name="P002" type="text" value="@Request["P002"]" /> </div> </td> <td class="tdqcss" valign="middle" style="width:*"> <input type="submit" value="查询" class="btcss" /> </td> </tr>}
[HttpGet] public ActionResult Index(int pageIndex = 1) { int total = 0; //绑定地市 ViewBag.PP = PP(false); //绑定品牌 ViewBag.DS = DS(false); if(!string.IsNullOrEmpty(Request["t001"])) total = Convert.ToInt32(System.Text.Encoding.Default.GetString(Convert.FromBase64String(Request.QueryString["t001"].ToString().Replace("%2B", "+")))); //查询条件 string[] param = Param(Request.QueryString); IList<T002> l = GetList(out total, param[0], pageIndex); PagedList<T002> lto = new PagedList<T002>(l, pageIndex, 30, total, param[1]); return View(lto); } [HttpPost] public ActionResult Index() { int total = 0; //绑定地市 ViewBag.PP = PP(true); //绑定品牌 ViewBag.DS = DS(true); //查询条件 string[] param = Param(Request.Form); IList<T002> l = GetList(out total, param[0], 1); PagedList<T002> lto = new PagedList<T002>(l, 1, 30, total, param[1]); return View("Index",lto); }