PageAdmin网站内容管理系统(CMS)交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

搜索功能的翻页既然无法使用 [复制链接]

1#
这是原模版代码
  1. @{
  2.     int columnId = Html.CurrentColumnId();//当前栏目id
  3.     PageInfo pageInfo = new PageInfo()
  4.     {
  5.         PageSize = 10,//每页显示12条数据
  6.         CurrentPage = (int)ViewBag.CurrentPage //当前页码,系统预设
  7.     };
  8.     string kw = StringHelper.Format<string>(HttpContext.Current.Request.QueryString["kw"]);
  9.     int id = StringHelper.Format<int>(HttpContext.Current.Request.QueryString["ids"]);
  10.     IEnumerable<dynamic> dataList = null;
  11.     if (id == 2)
  12.     {
  13.         dataList = Html.InfoDataList(new { Table = "product" }, "title like @kw", new { kw = "%" + kw + "%" }, pageInfo);
  14.     }
  15.     else
  16.     {
  17.         dataList = Html.InfoDataList(new { Table = "news" }, "title like @kw", new { kw = "%" + kw + "%" }, pageInfo);
  18.     }
  19.     var columnContentData = Html.ColumnContentData();
  20.     string zdytitle = columnContentData.Zlmlmmc;
  21. }

  22. @Html.Partial("xBannerPartial")

  23. <div class="container">
  24.     <div class="web_navs1">
  25.         @Html.Partial("subNavPartial")
  26.     </div>
  27.     <div class="web_navs1 margin-top-30 margin-bottom-30">
  28.         @Html.Partial("subNavPartial")
  29.     </div>
  30.     <div class="web_wz_wc margin-top-30 margin-bottom-30">
  31.         <div class="zlm_news_mx web_wzwc_com">
  32.             @foreach (var item in dataList)
  33.             {
  34.                 string title = item.Title;
  35.                 if (title.Length > 30)
  36.                 {
  37.                     title = title.Substring(0, 30) + "...";
  38.                 }
  39.                 string introduction = item.Introduction;
  40.                 if (introduction.Length > 70)
  41.                 {
  42.                     introduction = introduction.Substring(0, 70) + "...";
  43.                 }
  44.                 string date = item.Thedate.ToString("dd");
  45.                 string dates = item.Thedate.ToString("yyyy-MM");
  46.                 string url = Html.InfoDataUrl((int)item.ColumnId, (int)item.Id);
  47.                 string thumbnail = item.Thumbnail;
  48.                 {

  49.                     <div class="news_lis">
  50.                         <div class="news_lis_date">
  51.                             <span class="s1">@dates</span>
  52.                             <span class="s2">-@date</span>
  53.                         </div>
  54.                         <a href="@url" class="titles">@title</a><br />
  55.                          <div class="item">
  56.                 <div class="img"><a href="@url" class="titles"><img src="@(item.Thumbnail)" /></a></div>
  57.                 <div class="coms"><p style="color:#999999">@introduction</p></div>
  58.             </div>
  59.                         
  60.                     </div>

  61.                 }
  62.             }
  63.         </div>
  64.         @Html.Partial("PagebreakPartial", pageInfo)
  65.     </div>

  66. </div>
复制代码
搜索的结果点下一页既然错误,没发现哪里错了
分享 转发
TOP
2#

刚想来学习一下就看到楼主的帖子了,我试了一下,也是同样的翻页错误。。。
润滑油网www.omnipo.hk  网站收录www.omnipo.cn  网站评估www.omnipo.com.cn  网址导航www.36dir.com  快递查询www.oks.net.cn
TOP
发新话题 回复该主题