Working with the Search Paging Web Part
The Search Paging Web Part lets the shopper iterate through the search results. The shopper can specify a property to sort by and the number of search results to return per page. The Sort by property applies to product search results only. If no results are found, this Web Part is hidden.
The Search Paging Web Part must be connected to a Search Result Web Part. The Search Result Web Part provides the information about total records found for the search request.
This is a user control-based Web Part.
Architecture
The Web Part updates the URL query string parameters and submits the page.
The Web Part always posts back to the current URL.
To connect to a Search Results Web Part, add the Search Results Web Part to the page. Use the edit option on the Search Paging Web Part, select Connections, select Get Search Results Count Parameter from, and then select Search Results Web Part.
Properties
The following table lists the mapping of the properties for the Search Paging Web Part
Property |
Maps to |
Type |
Description |
Default value |
---|---|---|---|---|
Display "Sort By" drop-down |
ShowSortingList |
Boolean |
If checked, causes the Web Part to display the "sort by" drop-down which allows the user to change the field being used to sort. |
True |
Display "# results per page" drop-down |
ShowResultsPerPage |
Boolean |
If checked, causes the Web Part to display a drop-down allowing the user to select a number of results per page |
True |
Minimum selectable # of results per page |
MinResultsPerPage |
Int |
Sets the lower-bound for the number of results per page that a user can select. This setting, combined with the "minimum # of results per page" setting, will determine the range of options displayed in the "results per page" drop-down. |
10 |
Maximum selectable # of results per page |
MaxResultsPerPage |
Int |
Sets the upper-bound for the number of results per page that a user can select. This setting, combined with the "minimum # of results per page" setting, will determine the range of options displayed in the "results per page" drop-down. |
20 |
"Previous" link text |
PrvLinkLabelText |
String |
Sets the text displayed on the "previous" link. |
Prev |
"Previous" link image URL |
PrvLinkImageUrl |
String |
Sets the file URL of the image displayed on the "previous" link. |
Blank |
"Next" link text |
NextLinkLabelText |
String |
Sets the text displayed on the "next" link. |
Next |
"Next" link image URL |
NextLinkImageUrl |
String |
Sets the file URL of the image displayed on the "next" link. |
Blank |
Maximum # of page links before current |
MaximumPageLinksBeforeCurrent |
Int |
Sets the number of page links to display before the current page number, after which the remaining page numbers are ellipsed. |
3 |
Maximum # of page links after current |
MaximumPageLinksAfterCurrent |
Int |
Sets the number of page links to display after the current page number, after which the remaining page numbers are ellipsed. |
3 |
"Page" text |
LinksText |
String |
Sets the text displayed before the number of the current page. |
Blank |
"Results per page" label text |
ResultsPerPageListText |
String |
Sets the text displayed beside the "results per page" drop-down. |
Results per page |
"Sort by" label text |
SortingByListText |
String |
Sets the text displayed beside the "sort by" drop-down. |
Sort by |
"Showing records" text |
ShowingRecordsText |
String |
Sets the text displayed beside the display of the current range of results. |
Showing records {0} to {1} of {2} |
User Control name |
UserControlName |
String |
The name of the user control that displays the search paging web part. |
SearchPaging.ascx |
Customization
You can customize Search Paging Web Part by using HTML and CSS in the control.
Error Handling
The Search Paging Web Part returns friendly error messages when required fields have not been supplied.
API Dependencies
Catalog API: Use to get the list of product categories.
See Also
Other Resources
Developing with SharePoint Commerce Services