Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

ASP.NET 2.0 Quickstart Tutorials

Authorizing Web Parts

The web parts control set includes a mechanism to authorize web parts that applies to all the ASP.NET server controls when adding or importing those to a page. Page developers implement an authorization filter by subscribing to the WebPartManager.OnAuthorizeWebPart event.

This example shows a page that displays web parts that are of type Calendar:
  1. Log in to the page. Calendars are displayed in the page.
  2. Select "Catalog" from the dropdown. The CatalogZone will now be visible and will display a calendar control.
VB Autorizing Web Parts
Run Sample View Source

You should inherit from the WebPartManager class and override the IsAuthorize method if the implementation of the WebPartManager.OnAuthorizeWebPart is the same across multple pages. This approach will prevent redundant code across pages.