Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

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#" %>
<html>
<head id="Head1" runat="server">
  
</head>
<body>
  <form id="Form1" runat="server">
  	<asp:webpartmanager id="WebPartManager1" runat="server" />
    <asp:webpartzone
      id="WebPartZone1"
      runat="server"
      title="Zone 1">
        <parttitlestyle 
          font-bold="true" 
          BorderWidth="2" 
          ForeColor="#3300cc" />
        <partstyle
          borderwidth="1px"   
          borderstyle="Solid"  
          bordercolor="#81AAF2" />
        <zonetemplate>
          <asp:calendar 
            ID="cal1" 
            Runat="server" 
            Title="My Calendar" />
          <asp:Label id="label1" runat="server" 
            Title="A WebPart Label">
            The label control acts as a WebPart.
          </asp:Label>
      	</zonetemplate>
    </asp:webpartzone>
  </form>
</body>
</html>

System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Web.UI.WebControls.Style
         System.Web.UI.WebControls.TableItemStyle
          System.Web.UI.WebControls.WebParts.TitleStyle
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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.