Creating a User Control

The first kind of customization we will look at is user controls, which are like markup templates that you can reuse in different pages. By contrast, the controls you saw in the previous chapter were all server controls. The differences between these types of controls will become apparent as we proceed. I'll show you how to customize server controls and create new ones later in this chapter.

User controls can be helpful when you have a block of markup that you want to use throughout your web application, such as a set of labels and text boxes that gather a user's name and e-mail address. Rather than re-create the markup required for this multiple times, you can create a user control.

To demonstrate how user controls work, ...

Get Applied ASP.NET 4 in Context 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.