Last post Oct 02, 2018 03:07 AM by firstname.lastname@example.org
Sep 29, 2018 05:35 PMemail@example.com|LINK
New to ASP.Net MVC, just spent 2 hours following "https://www.youtube.com/watch?v=u147Q0NY6Qg&t=871s" to implement "Paging, Sorting and Filtering" in MVC via jQuery DataTables. But
I am not satisfied with the way using jQuery DataTable.
Wondering if there is other way to implement Paging, Sorting and Filtering no matter in MVC or Razor page. Any clue HELP!
Sep 30, 2018 05:03 AM|KathyW|LINK
Since you didn't say what you didn't like about what you tried (JQuery data table), it would be hard to suggest something better. You can certainly search yourself for "MVC table with sorting paging and filtering" and find many options, and you would be
in the position to decide which ones you like.
Sep 30, 2018 05:28 AMfirstname.lastname@example.org|LINK
Sep 30, 2018 05:38 AM|KathyW|LINK
There is no "official" way. There are many examples of how to do it - click on the search link in my previous response and look at some options.
Sep 30, 2018 05:43 AMemail@example.com|LINK
Sep 30, 2018 06:10 AM|KathyW|LINK
There is a core Razor example in my search results. You didn't say if you were using core or not. Change the search to specify what you are using.
Oct 01, 2018 10:37 AM|Yuki Tao|LINK
Later, I will try webgrid. But still any clue helps.
Although it's convenient to use plugins sometimes, you have to take the time to really understand plugins if you're doing more complicated functions.
I do recommend you could refer to this link,I think this is simpler than webgrid,:
In this tutorial you could learn how to create a data model and implement basic CRUD,
sorting, filtering, paging(PagedList.Mvc), and grouping functionality.
Oct 01, 2018 11:21 AM|Mikesdotnetting|LINK
There is also a Razor Pages version: https://docs.microsoft.com/en-us/aspnet/core/data/ef-rp/sort-filter-page?view=aspnetcore-2.1
Oct 01, 2018 12:46 PMfirstname.lastname@example.org|LINK
Thanks, Yuki Tao. I will try it !!!
Oct 01, 2018 12:47 PMemail@example.com|LINK
Thanks for your information, Mike. Will try it.
Oct 01, 2018 03:19 PMfirstname.lastname@example.org|LINK
According to the url mentioned,
"Razor Pages is a new aspect of ASP.NET Core MVC that makes coding page-focused scenarios easier and more productive." and
"Razor Pages is the recommended approach to create a new Web UI app with ASP.NET Core 2.0."
It seems razor page is newer than the ASP.Net MVC way.
But my problem is the same with the below post comes from "Stackoverflow"
Oct 01, 2018 06:56 PM|Mikesdotnetting|LINK
You can implement pagination in any way you like. The basics are simple: you need to know how many records there are in total, and you need to know which page you are currently on. Then you need to get the records for the current page. Most often you use
Skip and Take for that. Then you need to decide on what kind of paging links you want - one for each page, or a Prev Next combination etc.
And yes, Razor Pages is newer than MVC. It is built on top of MVC, so much of what you see in MVC can be used in Razor Pages.
Oct 02, 2018 03:07 AMemail@example.com|LINK
After checking the example MS provided, I have to say the "JQuery plugin" way is really great !!!