ASP.NET CaptionAlign Property

Definition and Usage

The CaptionAlign property sets or returns the alignment of the calendar's title text.

Syntax

<asp:Calendar Caption="text" CaptionAlign="align" runat="server" />
Property Description
align

Specifies the alignment of the title text.

Possible Values:

  • Top - The title is displayed at the top of the calendar. Text is centered.
  • Bottom - The title is displayed at the bottom of the calendar. Text is centered.
  • Left - The title is displayed at the top of the calendar. Text is aligned to the left.
  • Right - The title is displayed at the top of the calendar. Text is aligned to the right.

Example

The following example sets the Caption in the calendar, placing the title at the bottom of the calendar:

<form runat="server">
<asp:Calendar id="cal1" runat="server"
Caption="This is a Caption text"
CaptionAlign="bottom" />
</form>

Example

Set the Caption Property of the Calendar Control