13.1. Working with data in web forms applications

Data binding in web forms is supported by the very flexible declarative syntax that permits us to specify the source of data. Here is an example:

<%# CustomerID %> 

Such a declaration can be placed anywhere on a page and will be evaluated when the Page.DataBind() method is called. Note that this is similar to ASP’s:

<% =CustomerÏID %> 

but the difference here is when the declaration is evaluated – in ASP it will be evaluated when the page is processed.

In this chapter, we will discuss how to use the following data-bound ASP.NET controls:

  • Repeater;

  • DataList;

  • DataGrid;

as well as how to use data binding with other ASP.NET controls.

Repeater control

The Repeater control is the simplest data binding ...

Get A Programmer's Guide to .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.