• Sitemap
  • Contact
  • "Chapter 1. An Introduction to the DataGrid, DataList, and Repeater"
  • "What Are Data Web Controls?"
  • "The DataGrid Web Control"
  • "The DataList Web Control"
  • "The Repeater Control"
  • "Determining What Data Web Control to Use"
  • "Summary"
  • "On the Web"
  • "Chapter 2. Binding Data to the Data Controls"
  • "Specifying a 'DataSource'"
  • "The Ins and Outs of the 'DataBind()' Method"
  • "Building a Class that Implements 'IEnumerable'"
  • "Summary"
  • "On the Web"
  • "Chapter 3. Customizing the HTML Output"
  • "Specifying Display Properties in the DataGrid and DataList"
  • "Customizing Data-Binding Output in Templates"
  • Previous Section Next Section

    Chapter 1. An Introduction to the DataGrid, DataList, and Repeater


    The DataGrid, DataList, and Repeater are three Web controls provided by ASP.NET, each of which can be used to display data on an ASP.NET Web page. At first glance, these three controls might seem very similar. After all, they are all useful for displaying data in a structured manner, as we'll briefly touch upon in this chapter, but that is about where the similarities end. Their differences, which we'll also be examining in this chapter, are subtler.

    Along with the similarities and differences among these controls, each control carries with it a set of advantages and disadvantages. For example, the DataGrid Web control provides built-in capabilities for paging and sorting the data, while the Repeater does not. However, the DataGrid is always rendered as an HTML table, whereas the Repeater allows for much more flexibility, allowing the developer to specify exactly the HTML that should appear in the rendered output.

    When using these controls in a real-world project, one must examine the subtle differences between them, along with their associated advantages and disadvantages, when deciding which control to use for a given situation. This chapter concludes with a discussion of what controls are appropriate in what circumstances, along with some real-world examples and what controls one might want to use.

      Previous Section Next Section
      th    nd    Buttons   DataGrid   Listing   DataList   control)    controls   event   property   table   Control   code   appearance   Server   Columns   Page   Adding   property   hyperlinks   fields   assigned   DataGrid's   Chapter   Examples   DataSource   Controls   values   used   runatserver   user