BaseAreaWebPart Class

The BaseAreaWebPart class creates Web Parts that act like portals.

Microsoft.SharePoint.Portal.WebControls.CacheableWebPart

   Microsoft.SharePoint.Portal.WebControls.BaseAreaWebPart

Public Constructors

The following table shows the constructors of the BaseAreaWebPart class and a brief description of each.

Name Description
BaseAreaWebPart Reserved for internal use only

Public Methods

The following table shows the public methods of the BaseAreaWebPart class and a brief description of each.

Name Description
Dispose Reserved for internal use only

Protected Methods

The following table shows the protected methods of the BaseAreaWebPart class and a brief description of each.

Name Description
GetAreaInformation Gets information about the area.
GetAreaPath Gets path of the area.
GetItemsAndAreas Gets a list of all the listings and subareas under the current category/specified category for the number of layers specified. If layers are not specified the GetItemsAndAreas method will return listings and sub-areas from two layers.
GetSubAreas gets the listings and subareas of the current category from the number of layers specified.
GetSubAreasFromAnchor Gets subareas from the anchor area.
OnLoad(object, System.EventArgs) Determines what queries need to be issued based on whether the inheriting class sets properties such as IssueSubAreaQuery to true or false. If the inheriting class needs to do stuff in its Onload method, such as set public properties and so on, it needs to make sure to call the base classes onload method (for example, base.OnLoad(object,eventargs)).
OnPreRender(object, System.EventArgs) This is the phase of the control life cycle when the base area Web Part has already issued the query and populated the array list structures to return the data to the user. Again, if the user overrides the OnPreRender method of his Web Part, the user must make sure to call base.OnPreRender(…) as well; otherwise, the base classes methods will not be executed.

Public Properties

The following table shows the properties of the BaseAreaWebPart class, the data type of each property, and a brief description of each.

Name Data Type Description
AnchorAreaId String Gets or sets the unique identifier of the area to which the Web Part is to be anchored.
CurrentAreaId String Gets or sets the unique identifier of the current area.
IssueAreaInformationQuery Boolean Gets or sets a value indicating whether to issue a query for area detail.
IssueAreaPathQuery Boolean Gets or sets a value indicating whether to issue a query for a breadcrumb.
IssueItemsAndAreasQuery Boolean Gets or sets a value indicating whether to issue a query for listings summary.
IssueSubAreasQuery Boolean Gets or sets a value indicating whether to issue a query for the TOC.
IssueSubAreasFromAnchorQuery Boolean Gets or sets a value indicating whether to issue a query for the horizontal navigation bar.
Layers Int32 Gets or sets the number of layers of data to be returned. The default is 2.

Nested Classes

The following table shows the nested classes of the Application class and provides a brief description of each.

Class Description
AreaReturnData Returns data for the Render method.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Remarks

Microsoft recommends that you use the BaseAreaWebPart class to create portal-like Web Parts rather than using the SiteData Object model to create them.

Example

The following code example shows the use of the BaseAreaWebPart class.

Requirements

Namespace: Microsoft.SharePoint.Portal.WebControls

Platforms: Microsoft Windows Server 2003

Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Security: Code Access Security