The Result control handles the display of search results returned by the Live Search web
service. On the first query to Live Search, the Search control will set up the Result control??™s
DataSource property with an instance of SearchResponse and call its DataBind method to have it
bind its templates to the result set. This mimics the behavior of data-bound controls discussed
in Chapter 7.
The Pager control is the third main control in our control library and is embedded as a
child control of the Result control. If paging is enabled, the Result control passes the Pager
control the result set so that it calculates the starting index offsets based on page size and
renders page links.
Figure 12-6 shows the action that occurs with the Search, Result, and Pager controls on an
initial search. The end result is a rendered page with embedded links that lets the page post
back to itself to change the view of the search results.
594 CHAPTER 12 ?– B U ILDING A COMPLEX CONTROL
Figure 12-5. The architecture of the Live Search controls
Figure 12-6. Controls in action on an initial search
Search
Result
Search
1. Query params
2. Return
Live Search
3. Locate Result control and data bind
4. Display templates
5.
Pages:
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783