Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 14. Customizing Placeholder Cont... > Deriving from the BasePlaceholderCon... - Pg. 275

Customizing Placeholder Controls 275 Deriving from the BasePlaceholderControl Class One technique of building custom placeholder controls is to create Web Custom Controls that inherit directly from the BasePlaceholderControl class. This is probably the most popular and also the best documented method. The result is a set of Web Custom Controls that can be distributed to any MCMS web project that requires them. Don't confuse Web Custom Controls with the Web User Controls we built in Chapter 13. The table below lists the differences between the two. Web Custom Control Re-usable across multiple projects. Compiled into a library file that can be referenced by any project. If you are building a control that could be used across multiple projects, consider using Web Custom Controls instead of Web User Controls. Generally harder to create. All logic has to be coded from within a code-behind file. Relatively easy to create. Designer interface allows drag and drop of existing controls to create a composite control. Web User Control Good for use only within the project file. If we wanted to share it with another project, we would have to duplicate the code. About the BasePlaceholderControl Class All custom placeholder controls are directly or indirectly inherited from the BasePlaceholder- Control class (which in turn is inherited from the ASP.NET WebControl class) and are members of the Microsoft.ContentManagment.WebControls namespace. The BasePlaceholderControl class contains methods that determine how all placeholder con- trols behave in both presentation and authoring modes.