Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Razor JSON to list
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Skythrust" data-source="post: 476981" data-attributes="member: 87030"><p>I am a bit further in my project for now. Since I am able to read the string to a list. I also made a OrderBy option.</p><p></p><p>Now just 1 thing left over here and that is to realize pagination ToList();</p><p></p><p>On the internet I found this code below. but whatever I try I am able to see all the records or nothing.</p><p></p><p>[CODE=csharp]</p><p>int pagesize = 10;</p><p>int countitems = Persons.Count(); // Does have 17 records</p><p>int pagecount = countitems % pagesize <= 0 ? countitems / pagesize : (countitems / pagesize) + 1;</p><p>for (int page = 0; page < pagecount; page++)</p><p>{</p><p> Persons = Persons.Skip(page * pagesize).Take(pagesize).ToList();</p><p>}[/CODE]</p><p></p><p>Next of this I would like to apply an autorefresh to pages. So after 10 seconds show me page 2 etc. etc.</p><p></p><p>Can anyone help me with this?</p></blockquote><p></p>
[QUOTE="Skythrust, post: 476981, member: 87030"] I am a bit further in my project for now. Since I am able to read the string to a list. I also made a OrderBy option. Now just 1 thing left over here and that is to realize pagination ToList(); On the internet I found this code below. but whatever I try I am able to see all the records or nothing. [CODE=csharp] int pagesize = 10; int countitems = Persons.Count(); // Does have 17 records int pagecount = countitems % pagesize <= 0 ? countitems / pagesize : (countitems / pagesize) + 1; for (int page = 0; page < pagecount; page++) { Persons = Persons.Skip(page * pagesize).Take(pagesize).ToList(); }[/CODE] Next of this I would like to apply an autorefresh to pages. So after 10 seconds show me page 2 etc. etc. Can anyone help me with this? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Razor JSON to list
Top