Special Edition Using ASP.Net

   

In this chapter

Repeater Control

DataList Control

DataGrid Control

The DrugHistory Application

ASP.NET has three powerful data bound controls that make your job as an ASP developer much easier. There is a Repeater control, which enables you to do some pretty simple outputting of data. There is a DataList control that is more powerful and enables you to do more complex output. And there is a DataGrid control, which gives you great flexibility in presenting data to users and allowing them to edit the data.

These data controls can take data that is in some sort of collection, such as an array or a recordset, and render it to the HTML stream. Although you could do this all yourself by hand simply by using Response.Write() , the data bound controls give you a much more unified programming model with which you can create your applications.

In this section, I start off by showing you how to use the Repeater control. I then show you the DataList control and how to best use it. Then I show you the DataGrid control. This rich control almost deserves its own book, so even after I have presented the material, there will be much more that you can find out on your own. I don't know of any online resources right now that offer more information on the DataGrid control, but I plan to add articles to www.UsingASP.net in the future. The last thing that I do in this chapter is present a complete application named DrugHistory, which allows users to select a pharmaceutical from a drug database and then insert it into a table that lists the user 's prescription histories.

   

Категории