This documentation is archived and is not being maintained.

Calendar.PrevMonthText Property

Gets or sets the text displayed for the previous month navigation control.

[Visual Basic]
Public Property PrevMonthText As String
[C#]
public string PrevMonthText {get; set;}
[C++]
public: __property String* get_PrevMonthText();
public: __property void set_PrevMonthText(String*);
[JScript]
public function get PrevMonthText() : String;
public function set PrevMonthText(String);

Property Value

The caption text for the previous month navigation control. The default value is "&lt;", which renders as the less than sign (<).

Remarks

Use the PrevMonthText property to provide custom text for the previous month navigation control. This property is commonly used along with the NextMonthText property to provide a custom set of navigation controls.

Note   This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value &gt;.

Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the PrevMonthText property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an <img> element.

This property only applies if the ShowNextPrevMonth property is set to true.

Example

[Visual Basic, C#, JScript] The following example demonstrates how to use the PrevMonthText property to specify custom text for the previous month navigation control.

[Visual Basic] 
<%@ Page Language="VB" AutoEventWireup="True" %>
<html>
<head>

</head>
<body>

   <form runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
           NextMonthText="Next"
           PrevMonthText="Prev"/>
            
   </form>
        

</body>
</html>


[C#] 
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>

</head>
<body>

   <form runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
           NextMonthText="Next"
           PrevMonthText="Prev"/>
            
   </form>
        

</body>
</html>


[JScript] 
<%@ Page Language="JScript" AutoEventWireup="True" %>
<html>
<head>

</head>
<body>

   <form runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
           NextMonthText="Next"
           PrevMonthText="Prev"/>
            
   </form>
        

</body>
</html>

[C++] No example is available for C++. To view a Visual Basic, C#, or JScript example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

Calendar Class | Calendar Members | System.Web.UI.WebControls Namespace | ShowNextPrevMonth | NextMonthText

Show: