GenericWebPart.Title Property
Assembly: System.Web (in system.web.dll)
public: virtual property String^ Title { String^ get () override; void set (String^ value) override; }
/** @property */ public String get_Title () /** @property */ public void set_Title (String value)
public override function get Title () : String public override function set Title (value : String)
Property Value
A string that represents the title of the part control. The default value is an empty string ("").The visible title text in a part control's title bar is set by the Title property.
If you do not supply a title for a control, the Web Parts control set automatically calculates a default string to use as a title. For more information, see DisplayTitle. Also, it is possible to provide a default subtitle that is appended to the title string. For details, see Subtitle.
This property overrides the base property so that you can access the property on the child control as if it were a true WebPart control.
You can set values for the property on your control in the declarative markup of a Web page, as well as programmatically. To provide a default value for the property whenever the control is used, you can implement the IWebPart interface.
The following code example demonstrates declarative and programmatic use of the Title property. The complete source code for the example is found in the Example section of the GenericWebPart overview topic.
The first part of the code example shows how the Title property is set declaratively on a server control within a WebPartZone control.
The second part of the code example demonstrates how to access the property programmatically to display its value in a label.
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.