|
Home > Archive > Microsoft Content Management Server > January 2005 > Is there any quickly method for customer paging?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Is there any quickly method for customer paging?
|
|
|
| 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();
///////////////////////////////////////////////////////////
| |
| Stefan [MSFT] 2005-01-28, 7:51 am |
| Hi M,
never(!) use more than 300 direct childs in a container.
This will cause significant performance impact.
See the following two articles for details:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm#4009EC9B-3902-4625-93EB-B6F5777BDDF2
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm#EF1C562B-7BF2-4503-85C2-DA150EAA4F1C
For your site please have a look in the following performance planning
whitepaper:
http://www.microsoft.com/downloads/...&DisplayLang=en
Cheers,
Stefan.
"M.Lee" <M.Lee@discussions.microsoft.com> wrote in message
news:054BF22E-D4DB-496F-BE94-2EF7CECAF783@microsoft.com...
> 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();
>
> ///////////////////////////////////////////////////////////
>
>
| |
|
|
|
|
|