Export (0) Print
Expand All

Calendar.SelectMonthText Property

Gets or sets the text displayed for the month selection element in the selector column.

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

Property Value

The text displayed for the month selection element in the selector column. The default value is ">>", which renders as two greater than signs (>>).

Remarks

Use the SelectMonthText property to provide custom text for the month selection element in the selector column.

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 >.

Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the SelectMonthText 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 SelectionMode property is set to CalendarSelectionMode.DayWeekMonth.

Example

[Visual Basic, C#, JScript] The following example demonstrates how to use the SelectMonthText property to provide custom text for the month selection element.

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

</head>
<body>

   <form runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
           SelectionMode="DayWeekMonth"
           SelectMonthText="&lt;*&gt;"
           SelectWeekText="-&gt;"/>
            
   </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"
           SelectionMode="DayWeekMonth"
           SelectMonthText="&lt;*&gt;"
           SelectWeekText="-&gt;"/>
            
   </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"
           SelectionMode="DayWeekMonth"
           SelectMonthText="&lt;*&gt;"
           SelectWeekText="-&gt;"/>
            
   </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 | SelectionMode

Show:
© 2014 Microsoft