Calendar::CaptionAlign Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the alignment of the text that is rendered as a caption for the calendar.

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

property TableCaptionAlign CaptionAlign {
	virtual TableCaptionAlign get();
	virtual void set(TableCaptionAlign value);

Property Value

Type: System.Web.UI.WebControls::TableCaptionAlign

A TableCaptionAlign value that indicates the alignment of the caption.

Exception Condition

The value specified is not one of the TableCaptionAlign values.

This property determines where the caption appears in relation to the Calendar control. The default value is NotSet, which lets the browser determine where to align the caption. The following table explains the relationship between the TableCaptionAlign value and the appearance of the caption.

TableCaptionAlign value



The caption appears at the bottom of the calendar, with the text centered.


The caption appears at the top of the calendar, with the text left-aligned.


The caption alignment is not set and is determined by the browser.


The caption appears at the top of the calendar, with the text right-aligned.


The caption appears at the top of the calendar with the text centered.

The following code example demonstrates how to use the CaptionAlign property to align a caption for a Calendar control.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top