hmgy
- PageAdmin新手
- 29
- 116
- 2018-06-23
|
1#
t
T
发表于 2019-11-09 16:53
|显示全部
这是原模版代码 - @{
- int columnId = Html.CurrentColumnId();//当前栏目id
- PageInfo pageInfo = new PageInfo()
- {
- PageSize = 10,//每页显示12条数据
- CurrentPage = (int)ViewBag.CurrentPage //当前页码,系统预设
- };
- string kw = StringHelper.Format<string>(HttpContext.Current.Request.QueryString["kw"]);
- int id = StringHelper.Format<int>(HttpContext.Current.Request.QueryString["ids"]);
- IEnumerable<dynamic> dataList = null;
- if (id == 2)
- {
- dataList = Html.InfoDataList(new { Table = "product" }, "title like @kw", new { kw = "%" + kw + "%" }, pageInfo);
- }
- else
- {
- dataList = Html.InfoDataList(new { Table = "news" }, "title like @kw", new { kw = "%" + kw + "%" }, pageInfo);
- }
- var columnContentData = Html.ColumnContentData();
- string zdytitle = columnContentData.Zlmlmmc;
- }
- @Html.Partial("xBannerPartial")
- <div class="container">
- <div class="web_navs1">
- @Html.Partial("subNavPartial")
- </div>
- <div class="web_navs1 margin-top-30 margin-bottom-30">
- @Html.Partial("subNavPartial")
- </div>
- <div class="web_wz_wc margin-top-30 margin-bottom-30">
- <div class="zlm_news_mx web_wzwc_com">
- @foreach (var item in dataList)
- {
- string title = item.Title;
- if (title.Length > 30)
- {
- title = title.Substring(0, 30) + "...";
- }
- string introduction = item.Introduction;
- if (introduction.Length > 70)
- {
- introduction = introduction.Substring(0, 70) + "...";
- }
- string date = item.Thedate.ToString("dd");
- string dates = item.Thedate.ToString("yyyy-MM");
- string url = Html.InfoDataUrl((int)item.ColumnId, (int)item.Id);
- string thumbnail = item.Thumbnail;
- {
- <div class="news_lis">
- <div class="news_lis_date">
- <span class="s1">@dates</span>
- <span class="s2">-@date</span>
- </div>
- <a href="@url" class="titles">@title</a><br />
- <div class="item">
- <div class="img"><a href="@url" class="titles"><img src="@(item.Thumbnail)" /></a></div>
- <div class="coms"><p style="color:#999999">@introduction</p></div>
- </div>
-
- </div>
- }
- }
- </div>
- @Html.Partial("PagebreakPartial", pageInfo)
- </div>
- </div>
复制代码搜索的结果点下一页既然错误,没发现哪里错了
|