# Calendar.Caption Property

.NET Framework 3.0
Gets or sets a text value that is rendered as a caption for the calendar.

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

## Syntax

```[LocalizableAttribute(true)]
public virtual string Caption { get; set; }
```
```/** @property */
public String get_Caption ()

/** @property */
public void set_Caption (String value)

```
```public function get Caption () : String

public function set Caption (value : String)

```
```Not applicable.
```

#### Property Value

The table caption.

## Remarks

A table caption is used to describe the nature of the table in one to three sentences. Use the CaptionAlign property to align the caption with the calendar.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

## Example

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

```<%@ Page Language="C#" AutoEventWireup="True" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<title> Calendar Caption and Caption Align Example </title>
<body>

<form id="form1" runat="server">

<h3> Calendar Caption and Caption Align Example </h3>

<br /><br />

<asp:Calendar id="Calendar1"
ShowGridLines="True"
ShowTitle="True"
Caption="This calendar is used to demonstrate a calendar caption. It also shows
how the caption can be aligned to the calendar, in this case to the right edge of
the calendar."
CaptionAlign="right"
runat="server"/>

<br /><br />

</form>

</body>
</html>

```

## Platforms

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

## Version Information

#### .NET Framework

Supported in: 3.0, 2.0