Chapter 15. Design-Time Functionality


Design-time functionality refers to the appearance, capabilities, and behavior of a control in a visual designer such as Microsoft Visual Studio .NET. The .NET Framework makes it possible for a custom control to offer the same experience in a designer as the standard ASP.NET controls. To begin with, a control inherits basic design-time functionality from the base Control class. Next the .NET Framework allows you to easily customize the default functionality of a control via design-time attributes. Finally, the .NET Framework provides a rich and flexible design-time architecture that enables you to implement advanced design-time features and associate them with your control.

In Chapter 5, "Developing a Simple Custom Control," we described the default design-time functionality available to a control. For example, you saw that without any additional work on your part, a page developer can add your control to the Toolbox of Visual Studio .NET, drag the control from the Toolbox onto the design surface, and select the control on the design surface to cause the property browser to display its properties and events. In Chapter 5 and Chapter 7, "Simple Properties and View State," we showed how you can customize your control's default design-time functionality by applying various design-time metadata attributes.

In this chapter, we will show you how to implement advanced design-time features, such as the special user interface (UI) offered by the DataList control for editing its template properties or the color picker UI offered by Web controls for editing their Color type properties. We will describe the design-time architecture of the .NET Framework, examine classes that provide advanced design-time functionality (namely type converters, designers, and editors), and show you how to extend those classes and associate them with your control. We'll complete our tour of design-time programming by describing how to debug design-time code.

Implementing design-time features is optional because the base Control class provides basic design-time functionality to a server control. However, depending on the functionality of your control, design-time features can greatly enhance the usability of your control in a visual design environment and turn a no-frills control into a professional-looking control that offers a rich design-time experience to the page developer. This difference is especially important if you are developing controls for commercial distribution.



Developing Microsoft ASP. NET Server Controls and Components
Developing Microsoft ASP.NET Server Controls and Components (Pro-Developer)
ISBN: 0735615829
EAN: 2147483647
Year: 2005
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net