01-28-05 12:51 PM
My code like this,but the line
"PostingCollection psts = chl.Postings;"
takes me about 20seconds to response where my channel has 4000 postings.
Is there a better and more quickly method for customer paging?
///////////////////////////////////////////
CmsHttpContext cxt = CmsHttpContext.Current;
Channel chl =
(Channel)(cxt.Searches.GetByPath("/Channels/www.mymcms.com/test"));
PostingCollection psts = chl.Postings;
string[] pstn = new string[10];
int pagenum = int.Parse(this.currpagenum.Value);
if (pagenum<0)
{
pagenum=0;
}
else if (pagenum*10>psts.Count)
{
pagenum = psts.Count/10;
}
int max = 10;
if ((pagenum+1)*10>psts.Count)
max = psts.Count-pagenum*10;
for(int i=0;i<max;i++)
{
pstn[i] = psts[pagenum*10+i].DisplayName;
}
this.DataGrid1.DataSource=pstn;
this.DataGrid1.DataBind();
///////////////////////////////////////////////////////////
[ Post a follow-up to this message ]
|