Table of contents
- 1 Constructors
- 2 Methods
- 2.1 CreatePageLink(Int32 page, String text) : String
- 2.2 CreatePageLink(Int32 page, String text, IDictionary htmlAttributes) : String
- 2.3 CreatePageLink(Int32 page, String text, IDictionary htmlAttributes, IDictionary queryStringParams) : String
- 2.4 CreatePagination(IList datasource, Int32 pageSize) : IPaginatedPage
- 2.5 CreatePagination(IList datasource, Int32 pageSize, Int32 currentPage) : IPaginatedPage
- 2.6 CreateCachedPagination(String cacheKey, Int32 pageSize, DataObtentionDelegate dataObtentionCallback) : IPaginatedPage
PaginationHelper API Document
This helper allows you to easily paginate through a data source (anything that implements System.Collections.IList)
Constructors
PaginationHelper()
Initializes a new instance of the Castle.MonoRail.Framework.Helpers.PaginationHelper class.
Methods
CreatePageLink(Int32 page, String text) : String
Creates a link to navigate to a specific page
| Parameter | Description |
|---|---|
| page | Page index |
| text | Link text |
CreatePageLink(Int32 page, String text, IDictionary htmlAttributes) : String
Creates a link to navigate to a specific page
| Parameter | Description |
|---|---|
| page | Page index |
| text | Link text |
| htmlAttributes | Attributes for the anchor tag |
CreatePageLink(Int32 page, String text, IDictionary htmlAttributes, IDictionary queryStringParams) : String
Creates a link to navigate to a specific page
| Parameter | Description |
|---|---|
| page | Page index |
| text | Link text |
| htmlAttributes | Attributes for the anchor tag |
| queryStringParams | Query string entries for the link |
CreatePagination(IList datasource, Int32 pageSize) : IPaginatedPage
Creates a Castle.MonoRail.Framework.Helpers.Page which is a sliced view of the data source
| Parameter | Description |
|---|---|
| datasource | Data source to be used as target of the pagination |
| pageSize | Page size |
CreatePagination(IList datasource, Int32 pageSize, Int32 currentPage) : IPaginatedPage
Creates a Castle.MonoRail.Framework.Helpers.Page which is a sliced view of the data source
| Parameter | Description |
|---|---|
| datasource | Data source to be used as target of the pagination |
| pageSize | Page size |
| currentPage | current page index (1 based) |
CreateCachedPagination(String cacheKey, Int32 pageSize, DataObtentionDelegate dataObtentionCallback) : IPaginatedPage
Creates a Castle.MonoRail.Framework.Helpers.Page which is a sliced view of the data source. This method first looks for the datasource in the System.Web.Caching.Cache and if not found, it invokes the dataObtentionCallback and caches the result using the specifed cacheKey
| Parameter | Description |
|---|---|
| cacheKey | Cache key used to query/store the datasource |
| pageSize | Page size |
| dataObtentionCallback | Callback to be used to populate the cache |