Calendar.PrevMonthText 属性

定义

获取或设置为前一月导航控件显示的文本。Gets or sets the text displayed for the previous month navigation control.

public:
 property System::String ^ PrevMonthText { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
public string PrevMonthText { get; set; }
public string PrevMonthText { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.PrevMonthText : string with get, set
member this.PrevMonthText : string with get, set
Public Property PrevMonthText As String

属性值

String

前一月导航控件的标题文本。The caption text for the previous month navigation control. 默认值为 "&lt;" ,它呈现为小于号 <) (。The default value is "&lt;", which is rendered as the less than sign (<).

属性

示例

下面的代码示例演示如何使用 PrevMonthText 属性指定上个月导航控件的自定义文本。The following code example demonstrates how to use the PrevMonthText property to specify custom text for the previous month navigation 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" >
<head>
    <title>Calendar Example</title>
</head>
<body>

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

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
           NextMonthText="Next"
           PrevMonthText="Prev"/>
            
   </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" >
<head>
    <title>Calendar Example</title>
</head>
<body>

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

      <h3>Calendar Example</h3>

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

</body>
</html>

注解

使用 PrevMonthText 属性为上个月导航控件提供自定义文本。Use the PrevMonthText property to provide custom text for the previous month navigation control. 此属性通常与属性一起使用 NextMonthText 以提供一组自定义的导航控件。This property is commonly used along with the NextMonthText property to provide a custom set of navigation controls.

备注

此属性不会自动编码为 HTML。This property does not automatically encode to HTML. 你需要将特殊字符转换为相应的 HTML 值,除非你希望将字符视为 HTML。You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. 例如,若要显式显示大于符号 ( # A0) ,必须使用值 &gt;For example, to explicitly display the greater than symbol (>), you must use the value &gt;.

由于此属性不会自动编码为 HTML,因此可以为属性指定 HTML 标记 PrevMonthTextBecause this property does not automatically encode to HTML, it is possible to specify an HTML tag for the PrevMonthText property. 例如,如果想要显示下个月导航控件的图像,则可以将此属性设置为包含元素的表达式 <img>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.

仅当属性设置为时,此属性才适用 ShowNextPrevMonth trueThis property applies only if the ShowNextPrevMonth property is set to true.

设置此属性后,可以使用设计器工具自动将此属性的值保存到资源文件中。The value of this property, when set, can be saved automatically to a resource file by using a designer tool. 有关详细信息,请参阅 LocalizableAttributeASP.NET 全球化和本地化For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

适用于

另请参阅