kentico - CMS Repeater Select top N row++ -


i need load more button control repeater shown content.

here steps in end after load more button clicked:

  1. repeater bind data (full data/all rows).
  2. keep maximum items count (static) repeater.
  3. set total row show (static) + 1 , initialize value select top n row limit.
  4. repeater bind data again (the amount show only).
  5. check if repeater items count less maximum items count, if not hide load more button.

suppose these steps can give me expected output?

//declaration public static int max = 0; public static int totalshow = 0;  //setupcontrol() if(!ispostback){   rptitems.classname = "blog";   rptitems.path = "/shared/%"   rptitems.databind();   max = rptitems.items.count(); }  //this part put under new function totalshow += 1; rptitems.selecttopn = totalshow; rptitems.databind(); lbnloadmore.visible = rptitems.items.count() < max; 

besides, i'm confusing functions shown below:

enter image description here

enter image description here

both class cmsrepeater, what's different? 1 should use in order set limits?

using static members not approach. values shared users of application. there better ways of storing user-specific data:

  • session (server-side)
  • js (client-side) , passing them server via query string or hidden field

regarding topn , selecttopn, same thing. it's because of backward compatibility.

from algorithmical point of view, there's no need bind data multiple times nor make more 1 round-trip database. need initialize datasource/repeater correct values.

i'd recommend reading following articles inspiration:


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -