This documentation is archived and is not being maintained.

TitleStyle Class

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)

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class TitleStyle : 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#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<html xmlns="" >
<head id="Head1" runat="server">
    <title>ASP.NET Example</title>
  <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.

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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0