目前文章页里的上一篇和下一篇是根据id来排序的,怎么改成自己设置的字段来排序呢
dynamic infoData = Html.InfoData();
dynamic prevData = Html.InfoDataPrevious("columnid=@columnId",new{columnId = columnId});
dynamic nextData = Html.InfoDataNext("columnid=@columnId", new{columnId =columnId});
<ul>
@if (prevData != null)
{
string url = Html.InfoDataUrl((int)prevData.ColumnId, (int)prevData.Id);
<li class="text-gray">上一篇:<a href="@url">@prevData.Title</a></li>
}
@if (nextData != null)
{
string url = Html.InfoDataUrl((int)nextData.ColumnId, (int)nextData.Id);
<li class="text-gray">下一篇:<a href="@url">@nextData.Title</a></li>
}
</ul>
这是目前的文章页上一篇和下一篇排序方式