It is likely that you will want to create custom collection filters that filter objects based on the conditions that meet the specific needs of your Web application. When creating collection filters, you may want to keep them simple and modular by limiting them to work with one or two conditions only. Remember that you can link as many filters together as you like in a chain.

To create custom collection filters, complete the following tasks:

  1. Create a collection filtering component. See Creating Custom Collection Filters.

  2. Configure your collection filtering component. See Configuring Custom Collection Filters.

  3. Create a resource that can access the collection filtering component. See Accessing a Collection Filtering Component

To demonstrate how to create a custom collection filter, this discussion walks you through implementing a fictitious filter called MembershipFilter. Consider that a site has two levels of membership: basic and premier. This filter ensures that members only see articles suited for their level of membership by removing all articles from a slot that are marked as appropriate for another membership level . Assume that the articles and user Profiles have a enumerated property named membershipLevel with values 0 (basic) and 1 (premier)

 
loading table of contents...