How do I do very large pagination in ASP.NET MVC? - asp.net-mvc

I am following the NerdDinner MVC application as a guide to do my paging. What if my results are more than 1000 pages, I want to show perhaps the numbers 1 2 3 4 5 .. 10 on the bottom of my page and perhaps something like >> to move to the next set of 10 or 100 pages.
How can I do this in MVC?

I use the implementation demonstrated by Martijn Boland at: http://blogs.taiga.nl/martijn/2008/08/27/paging-with-aspnet-mvc/

Go for JQuery Datatables. that's the easiest way to solve pagination issues.Return the controller as JsonActionResult and supply it to datatables data.
The remaning will be taken care by data tables. like pagination, search functionality at all.
Check this https://datatables.net/examples/

Related

Pagination in jsf2 in ui:repeat

I am creating web application for booking tickets. After querying from DB for given inputs now i have 230 records (ticket informations) which has been added to list ,as objects (pojo's) .in JSF i am using "ui:repeat" to iterate the list. Here got confused how to create pagination on this. (i want to display 40 records /page). I should not hit the backend for each and every "NEXT" or "PREVIOUS" click .. Any help would be thankful.
Note: when i hit search button my flow will navigate to result.jsf page where i passed the 230 records for display.
Technology: Spring web flow and JSF 2
simplest solution is to use PrimeFaces DataTable Pagination or equivalent without reinventing the wheel

Ruby on Rails catalog view

Can someone show me or know of a good example that shows how to display data in say a 4 x 3 grid with a pager in Ruby on Rails. The examples I'm finding all display the data in a top down manner. I'm looking for something more like a product grid that I can page through.
Have a look at the pagination railscasts, they are really helpful:
http://railscasts.com/episodes?utf8=%E2%9C%93&search=paginate

Render large portion of page using jQuery & AJAX

I have an ASP.NET MVC application with a page that displays a large table of rows & columns of information.
I have a textbox at the top of the page allowing a user to filter the results in the table. I want the user to be able to start typing a word in the textbox and with each keypress, the results in the table to be updated based on the users filter text.
I've done similar things where I simply return a JsonResult response from my Controller, with a couple of small bits of data, but am not sure of the recommended approach if I want to essentially re-render my whole table (with the new data within it) upon each keypress?
I should also mention that the ViewModel I intend to use when the page is first loaded (prior to any ajax stuff happening) contains an IPagedList, as the table data needs to be paginated and sortable.
What I would do is to work with JQuery ajax API and also with partial views.
Have a look at following article. It displays how you can be able to manipulate your html seamlessly on ASP.NET MVC :
Working With JQuery Ajax API on ASP.NET MVC 3.0 - Power of JSON, JQuery and ASP.NET MVC Partial Views
http://www.tugberkugurlu.com/archive/working-with-jquery-ajax-api-on-asp-net-mvc-3-0-power-of-json-jquery-and-asp-net-mvc-partial-views
Also, following question might help :
How to pass an array through in JQuery Ajax and how to concieve it in server side?
You can use the templates to render the html.
i.e Parametrized html + json = to be rendered html
MicroTemplates
Have a look at http://knockoutjs.com/ it could be a very good fit for you
Take a look at the DataTables plug-in for jQuery. It may match your requirements and provide exactly what you need.

Ruby On Rails: Fetching records

I'm looking for a tutorial or a piece of code that can leads me to create a page
where we can find only 10 data rows per page and navigating with Ajax previous/next arrows
and also page number (i.e.: < 1 2 3 ... 10 > ).
Thank you very much.
A good place to start is Mislav's will-paginate plugin. The Readme at that link should explain how to use it.
Edited:
There's also a screencast on RailsCasts about Ajax pagination. I haven't watched it, but his stuff is usually really high-quality and easy to follow.
it's not ajax but maybe it's useful for you... when you use haml and haml_scaffolding in rails it's authomatic the pagination using this kind of sacffolding

asp.net mvc generic/custom views

the routes are as follows
site.com/{section1}/{page1}
site.com/{section1}/{page2}
site.com/{section2}/{page3}
etc.
the pages are 2 column each where the left bar is different for each section
the page content is fetched from the database based on section + page combination
I'd like to make the page markup/layout/css be done/uploaded by the user
Questions:
hopefully this is implemented somewhere? any links?
how much can this be dumbed down?
what/how can checks be enforced so that the few required tags/markup are present/visible?
any gotchas?
figured it out using ActionAttribute

Resources