Skip to Main Content
Professional ASP.NET 2.0 Special Edition
book

Professional ASP.NET 2.0 Special Edition

by Bill Evjen, Scott Hanselman, Devin Rader, Farhan Muhammad, S. Srinivasa Sivakumar
October 2006
Intermediate to advanced content levelIntermediate to advanced
1588 pages
37h 59m
English
Wrox
Content preview from Professional ASP.NET 2.0 Special Edition

Chapter 25. User and Server Controls

In an object-oriented environment like .NET, the encapsulation of code into small, single-purpose, reusable objects is one of the keys to developing a robust system. For instance, if your application deals with customers, you might want to consider creating a customer's object that encapsulates all the functionality a customer might need. The advantage is that you create a single point with which other objects can interact, and you have only a single point of code to create, debug, deploy, and maintain. In this scenario, the customer object is typically known as a business object because it encapsulates all the business logic needed for a customer.

There are several other types of reusable objects available in .NET. In this chapter, we concentrate on discussing and demonstrating how you can create reusable visual components for an ASP.NET application. The two types of reusable components in ASP.NET are user controls and server controls.

A user control encapsulates existing ASP.NET controls into a single container control, which you can easily reuse throughout your Web project.

A server control encapsulates the visual design, behavior, and logic for an element that the user interacts with on the Web page.

Visual Studio ships with a large number of server controls that you are probably already familiar with, such as the Label, Button, and TextBox controls. This chapter talks about how you can create custom server controls and extend existing server ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition

Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition

Andrew Troelsen
ASP.NET 3.5 Unleashed

ASP.NET 3.5 Unleashed

Stephen Walther
Beginning Visual C#® 2005

Beginning Visual C#® 2005

Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, Eric White

Publisher Resources

ISBN: 9780470041789Purchase book