Prop Webcontrol Calendar Nextprevformat
## ASP.NET Calendar NextPrevFormat Property
The `NextPrevFormat` property is a member of the ASP.NET Web Control `Calendar` class. It is used to define the display format of the navigation links for the next and previous months in the calendar header.
---
## Definition and Usage
By default, the calendar control displays navigation arrows (like `<` and `>`) to allow users to navigate between months. The `NextPrevFormat` property allows you to customize these navigation links to display the names of the months instead of, or in addition to, the default text.
This property is only effective when the `ShowNextPrevMonth` property is set to `true` (which is its default value).
---
## Syntax
```xml
```
### Property Values
| Value | Description |
| :--- | :--- |
| `ShortMonth` | Displays the abbreviated name of the month (e.g., "Jan", "Feb"). |
| `FullMonth` | Displays the full name of the month (e.g., "January", "February"). |
| `CustomText` | Displays custom text defined by the `NextMonthText` and `PrevMonthText` properties (e.g., "Next >", "< Prev"). This is the default value. |
---
## Code Examples
### Example 1: Using "ShortMonth" Format
The following example demonstrates how to configure the Calendar control to display abbreviated month names for the next and previous month navigation links.
```xml
<%@ Page Language="C#" %>
Calendar NextPrevFormat Example
```
### Example 2: Using "FullMonth" Format
This example shows how to display the full month names in the navigation header.
```xml
```
### Example 3: Using "CustomText" Format
If you want to use custom text or HTML symbols for navigation, set the format to `CustomText` and specify your custom strings in `NextMonthText` and `PrevMonthText`.
```xml
```
---
## Considerations
1. **Localization:** When using `ShortMonth` or `FullMonth`, the month names are automatically localized based on the current culture settings of the application or the user's browser.
2. **Layout Space:** Be aware that using `FullMonth` can significantly increase the width of the calendar's title header. Ensure your page layout has enough space to accommodate longer month names (such as "September" or "December") without breaking the design.
3. **Dependency:** If `ShowNextPrevMonth` is set to `false`, the navigation controls are hidden, and the `NextPrevFormat` property will have no visible effect.
YouTip