Search
10
votes
Need more customization for Pager

Description

I all my projects Pager was used in mode like "<< <Back 1 2 3 4 _5_ 6 > >>". The only thing I can do with existing Pager is : "1 < > 6". But to do this I have to write following:

Html.Pager( ... ).First("1").Last(totalPages.ToString()).Next(">").Last("<").Format("").SingleFormat("").Replace(" | ", "");

And after all that there will be no page numbers between < and >.

Note: In my first example "<<" means - jump 10 pages back. "_5_" means current page.

So the question is, can be a way to create pagers like "<< <Back 1 2 3 4 _5_ 6 > >>" and "< Back 1 2 3 4 _5_ 6 >" (Like in Google)?

And also can I specify how page numbers will render? For example in block mode "_1_ 2 3 4 5 6 7 8 9 10 > >>", "<< < _11_ 12 13 14 15 16 17 18 19 20 > >>" (Show pages in each 10), or in around mode like "< 1 2 3 _4_ 5 6 7 >" (3 pages around), "_1_ 2 3 >" (2 pages around).

If it possible now, please advice me how to do it.
If not, it will be nice if these settings features would be added.

File Attachments

No files are attached

Comments

JeremyS wrote Aug 6 2011 at 10:27 AM
No update I'm afraid - I'm not actively working on MvcContrib at present. If someone would like to implement this functionality and submit it via a pull request then I'd be happy to apply it, but it's not something I'm likely to look at anytime soon.

rboarman wrote Aug 4 2011 at 1:05 AM
Jeremy - any update on this? I'd like to be able to display page numbrs ( 2 3 4 5 etc.). Thanks!

rboarman wrote Aug 4 2011 at 12:55 AM
Jeremy - any update on this? I'd like to be able to display page numbers (1 2 3 4 5 etc.). Thanks!

JeremyS wrote Jan 13 2011 at 3:48 PM
Hi Adam,

No, I'm afraid not - Razor's inline templating requires MVC3/.net 4.

Jeremy

abezulski wrote Jan 13 2011 at 11:05 AM
Hi Jeremy,

Thanks for an update. Will there be a backward compatibility with MVC2 once you make the changes after MVC3 release?
Cheers,
Adam

JeremyS wrote Jan 6 2011 at 4:50 PM
It's on my list of things to do, but it will not be until after the MVC3 release. It will take advantage of Razor's new inline-templating feature.

Jeremy

abezulski wrote Jan 6 2011 at 11:17 AM
Is there any update on that? I would like to see updated functionality for the Pager

Updating...
© 2006-2012 Microsoft | Get Help | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2012.2.15.18416