Chapter 4

Working with ASP.NET Server Controls

What You Will Learn in This Chapter:

  • What ASP.NET Server Controls are
  • The different kinds of server controls you have at your disposal
  • The common behavior shared among most of the server controls
  • How the ASP.NET run time processes the server controls on your page
  • How server controls are able to maintain their state across postbacks Code Downloads for this Chapter

You can find the code downloads for this chapter on the Download Code tab at The code is in the Chapter 4 download.

ASP.NET Server Controls are the workhorses of ASP.NET. Almost all the Web Forms pages you build in Visual Studio (VS) will contain one or more server controls. These controls come in all sorts and sizes, ranging from simple controls like a Button and a Label to complex controls like the TreeView and the ListView that are capable of displaying data from a data source (like a database or an XML file). You see these controls in Chapters 7, 13, and 14.

The architecture of ASP.NET Server Controls is deeply integrated into ASP.NET, giving the controls a feature set that is quite unique in today's technologies for building websites. This chapter shows you what server controls are, how they work, and which ones are available out of the box when you install VS.

The chapter starts off with a general discussion of server controls. You see how to define them in your code by adding them to Design or Markup View. ...

Get Beginning ASP.NET 4.5: in C# and VB now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.