This chapter is devoted exclusively to the topic of building Web Parts. You learn how to create Web Parts by creating User controls and by creating custom controls that derive from the base WebPart class. We also examine the important topic of authorization filters. You learn how to display different sets of Web Parts to different users. For example, you learn how to create Web Parts that only members of the Administrator role can view. Later in this chapter, custom Web Part verbs are discussed. You learn how to add custom menu items to a Web Part and execute server-side and client-side code when a user selects the menu item. This chapter also explores how you can add help to Web Parts. You learn how to open a modal dialog box that displays a help page. Warning For many of the samples to work in this chapter, you must enable authentication for your application. Windows authentication is enabled by default. For more information about authentication, see Chapter 20, "Using the Login Controls." Finally, the WebPartManager class is examined. You learn how to take advantage of this class to programmatically manipulate the Web Parts contained in a page. |