回复 18楼xiyou的帖子请问是这个文件吗?如果是那要怎么改呢?只要把搜索结果的所有“关键字”加黄色背景就可以。
/Model/NewsListModel.cshtml
- @{
- IEnumerable<dynamic> dataList = Model;
- }
- @if (dataList.Count() > 0)
- {
- int i = 1;
- foreach (var item in dataList)
- {
- string url = Html.InfoDataUrl((int)item.ColumnId, (int)item.Id);
- string date = item.Thedate.ToString("yyyy/MM/dd");
- string target = "_self";
- string title = item.Title;
- if (!url.Contains(item.Id.ToString() + ".cshtml"))
- {
- target = "_blank";
- title = "【外链】" + title;
- }
- url += "#wrapper_n";
- <li><a href="@url" title="@item.Title" target="@target">@title<span>@date</span></a></li>
- if (i % 5 == 0)
- {
- <hr>
- }
- i++;
- }
- }
复制代码