4.2. A Closer Look at ASP.NET Server Controls

Since you'll be working with server controls for most of the time when building your ASP.NET web pages, you need to know in detail how they work and how to use them. In the next section, you'll see how to add the controls to your pages and change the way they behave in the browser. In the section that follows, you get an overview of the behavior that all server controls have in common. When you understand this shared behavior, you'll find it easy to apply it to other, new controls as well, enabling you to get up to speed with them very quickly.

4.2.1. Defining Controls in Your Pages

As demonstrated in the previous Try It Out, you can simply drag controls from the Toolbox onto the design surface of the page. This makes it very easy to add a bunch of controls to a page to get you started. However, because of the way the design surface works, it's sometimes difficult to add them exactly where you want them. For example, it can be difficult to drag a control between the opening and closing tags of an HTML element. Fortunately, you can just as easily drag a control from the Toolbox in Markup View. Additionally, you can also type the control's markup directly in Markup View, letting IntelliSense help you with the different tags and attributes. You'll also find that the Properties Grid works in Markup View. Simply click the relevant markup, and the Properties Grid will be updated to reflect the tag you clicked. This makes it easy to change ...

Get Beginning ASP.NET 3.5: In C# and VB 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.