13.07.2015 Views

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

334<strong>ASP</strong>.<strong>NET</strong> <strong>3.5</strong>: A Beginner’s <strong>Guide</strong>Figure 13-3 C# and <strong>ASP</strong>.<strong>NET</strong> relations in establishing data bindingThe Label’s ID property, BindMe, invokes the DataBind()method to establish thebinding. The Text property of the Label actually accepts the bound data. To better see therelationship between the <strong>ASP</strong>.<strong>NET</strong> portions of the application, Figure 13-3 shows how thetwo are related.While this first example is very simple, it contains the key ingredients to data binding.Next, we’ll turn to using a table and a repeater.RepeaterThe Repeater web control is another one of those self-describing objects. Used with databinding, the Repeater acts like a loop repeating statements. However, instead of repeatingstatements, it repeats a table-making routine so that as long as data are available, it repeatstable rows. The table rows on the screen represent the table rows (records) in a table database.This next example moves into the realm of reading tables from a database rather thandata from any other source. In other words, we will be looking at binding ADO.<strong>NET</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!