TitleStyle Class

Note: This class is new in the .NET Framework version 2.0.

Specifies the style characteristics for the title bars of Web Parts controls within a zone.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

public sealed class TitleStyle : TableItemStyle
public final class TitleStyle extends TableItemStyle
public final class TitleStyle extends TableItemStyle

The TitleStyle class is used with zones to specify common style characteristics that apply to the title bars of Web Parts controls within the zones. The PartTitleStyle property contains a reference to a TitleStyle object for each zone.

A title bar for a control is rendered at run time as an HTML table cell. Because the TitleStyle class inherits from the TableItemStyle class, it allows you to set stylistic attributes for a title bar similar to the attributes for any table cell.

The following code example demonstrates the declarative use of the TitleStyle class. In the code for the following page, an <asp:calendar> element and an <asp:label> element appear within a zone, giving the corresponding controls genuine Web Parts functionality at run time. Notice that the <parttitlestyle> element, which contains several style attributes, applies to the title bars of both Web Parts controls contained within the zone.

<%@ page Language="c#" %>
<head id="Head1" runat="server">
  <form id="Form1" runat="server">
  	<asp:webpartmanager id="WebPartManager1" runat="server" />
      title="Zone 1">
          ForeColor="#3300cc" />
          bordercolor="#81AAF2" />
            Title="My Calendar" />
          <asp:Label id="label1" runat="server" 
            Title="A WebPart Label">
            The label control acts as a WebPart.

  • AspNetHostingPermission  for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.


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

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions