Chapter 5. Making Web Parts customizable
This chapter covers
One of the key features of Web Parts is that the user can customize them. The Web Part infrastructure was designed with this in mind; it provides several features to aid the developer. Web Parts and other controls in ASP.NET have properties that can be used to control the logic, appearance, and behavior. These properties are normally set in the code by the programmer, but Web Parts can be exposed and customized using the web interface.
This chapter shows how you as a developer can expose the properties to your end users so that they can customize or personalize them. You’ll learn the default Web Part properties; you’ll add your own properties and eventually create a custom interface for interacting with them. Properties can be simple types, such as strings or integers, which SharePoint supports. For advanced types and properties, there’s no out-of-the-box support for editing, which means that you need to implement the logic yourself for those.
SharePoint Server 2010 also includes support for targeting Web Parts to groups and audiences. I’ll show you how this works behind the scenes and explain how to implement a similar targeting behavior for SharePoint Foundation.