Duration: 21 minutes
Summary: In this video, we discuss template data access controls. Some of
the controls depend on templates to display data. You use the templates to
format the data the way you like. One of those controls is the Repeater. We
start by creating a repeater control. The data source of that controls is the
AdventureWorks database (Address and StateProvince tables). We build our data
source and the select statement by joining the two tables. However, if you try
to view the page at this stage, you will not see anything. We need to build our
template to view the data. We add an ItemTemplate element inside the Repeater
control. We use the Eval expression to evaluate the values of the columns and
display the one row at a time. We use another version of the Eval expression to
create a formatted string within a hyperlink to link to another page passing
the postal code as a query string.
of the development of example: Good coding standard
and simplified design to illustrate the key points.
Used: ASP.NET and Visual Studio 2010
Keyword: ASP.NET 4, Visual Studio 2010, Repeater Control, Eval,
ConnectionString, SelectCommand, HyperLink, DataSource.