Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the display format for the previous and next month navigation controls within the Calendar.
public enum class NextPrevFormat
public enum NextPrevFormat
type NextPrevFormat =
Public Enum NextPrevFormat
Name | Value | Description |
---|---|---|
CustomText | 0 | Custom text format for the month navigation controls on the Calendar. |
ShortMonth | 1 | Abbreviated month name format for the month navigation controls on the Calendar. For example, "Jan". |
FullMonth | 2 | Full month name format for the month navigation controls on the Calendar. For example, "January". |
<%@ 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" >
<script runat="server" >
void Selection_Change(Object sender, EventArgs e)
{
// Set the format for the next and previous month controls.
Calendar1.NextPrevFormat = (NextPrevFormat)DayList.SelectedIndex;
}
</script>
<head runat="server">
<title> Calendar NextPrevFormat Example </title>
</head>
<body>
<form id="form1" runat="server">
<h3> Calendar NextPrevFormat Example </h3>
Select a format for the next and previous month controls.
<br /><br />
<asp:Calendar id="Calendar1"
ShowGridLines="True"
ShowTitle="True"
runat="server"/>
<br /><br />
<table cellpadding="5">
<tr>
<td>
Format:
</td>
</tr>
<tr>
<td>
<asp:DropDownList id="DayList"
AutoPostBack="True"
OnSelectedIndexChanged="Selection_Change"
runat="server">
<asp:ListItem Selected="True"> Custom </asp:ListItem>
<asp:ListItem> ShortMonth </asp:ListItem>
<asp:ListItem> FullMonth </asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</form>
</body>
</html>
<%@ Page Language="VB" 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" >
<script runat="server" >
Sub Selection_Change(sender As Object, e As EventArgs)
' Set the format for the next and previous month controls.
Calendar1.NextPrevFormat = _
CType(DayList.SelectedIndex, NextPrevFormat)
End Sub
</script>
<head runat="server">
<title> Calendar NextPrevFormat Example </title>
</head>
<body>
<form id="form1" runat="server">
<h3> Calendar NextPrevFormat Example </h3>
Select a format for the next and previous month controls.
<br /><br />
<asp:Calendar id="Calendar1"
ShowGridLines="True"
ShowTitle="True"
runat="server"/>
<br /><br />
<table cellpadding="5">
<tr>
<td>
Format:
</td>
</tr>
<tr>
<td>
<asp:DropDownList id="DayList"
AutoPostBack="True"
OnSelectedIndexChanged="Selection_Change"
runat="server">
<asp:ListItem Selected="True"> Custom </asp:ListItem>
<asp:ListItem> ShortMonth </asp:ListItem>
<asp:ListItem> FullMonth </asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</form>
</body>
</html>
The NextPrevFormat enumeration represents the different styles for the next and previous month buttons on the Calendar.
CustomText allows the programmer to specify custom text for the navigation controls.
ShortMonth displays a three-letter abbreviation for the month.
FullMonth displays the entire month name.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in