I made it work, but I'm not sure if it's correct, maybe Guoqi or Jifeng can give a better explanation
First I created a content template like this
Code:
<%@ Control Language="C#" Inherits="Everest.CmsServices.MvcHelper.CmsUserControl" %>
<script runat=server>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!StringExtensions.IsNullOrEmptyTrim(Request.QueryString["pageSize"]))
{
PageSize = int.Parse(Request.QueryString["pageSize"]);
}
}
</script>
<div class="content_body">
<ul class="news_list_other">
<% foreach (var item in this.GetContents("Test"))
{%>
<li class="news_list_thread">
<div class="thumb">
<%=item["Title"]%>
</div>
</li>
<%}%>
</ul>
<%=this.Html.CmsPager(PageSize, PageIndex, TotalCount)%>
<% %>
</div>
then I put this in the page Url {PageIndex}/{PageSize}, and the default PageIndex=0&PageSize=2 (Page Size Didn't work as well as I imagined but ok)
I also Created two data rules one called test to get me the list, and another called TotalCount to return the count
the deal is this:
the property PageIndex gets the value from the querystring automatically, the TotalCount also gets its value from the datarule called TotalCount
but the page size don't, so I needed to put this onLoad Code in the content template
it works but i'm not sure it's correct