Prev | Current Page 769 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"


CHAPTER 12 ?–  BUILDING A COMPLEX CONTROL 593
Designing the Control Architecture
At this point, you have an understanding of how to access the Live Search web service, and you
have some code to invoke it to return a set of search results. In the next phase of this chapter,
you will learn how to display and interact with results from the Live Search web service.
The result set returned by the Live Search web service does not have the tabular structure
that traditional data-bound controls such as the Repeater control or the DataGrid control expect.
The top-level Live SearchResponse class contains an array of SourceResponse objects that represents
multiple search requests. A SourceResponse object contains the overall status information
about the search result, which would more likely be used as a header format. The SourceResponse.
Results property contains an array of Result instances with the URL data for display in a
repeating item format. The control we need to build has to work with the data on these two
separate levels to display it appropriately. We achieve this by having templates that bind to
different portions of the data source. We discussed how to create templates in Chapter 6.
Another major consideration is how to abstract communications with Live Search so that
a developer can quickly add search capabilities to his or her application.


Pages:
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781