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.

適用於

另請參閱