O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required