Chapter 28. Building Web Parts


In this Chapter

  • Creating Simple Web Parts

  • Filtering Web Parts

  • Creating Custom Web Part Verbs

  • Displaying Web Part Help

  • Managing Web Parts with the WebPartManager Control

  • Summary

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.




ASP. NET 2.0 Unleashed
ASP.NET 2.0 Unleashed
ISBN: 0672328232
EAN: 2147483647
Year: 2006
Pages: 276

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