Calendar.PrevMonthText 屬性

定義

取得或設定顯示於移往上個月份巡覽控制項的文字。

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

移往上個月份的巡覽控制項的標題文字。 預設值為 "&lt;" ,其會轉譯為小於符號 () < 。

屬性

範例

下列程式碼範例示範如何使用 PrevMonthText 屬性來指定上個月導覽控制項的自訂文字。

<%@ 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使用 屬性來提供上個月導覽控制項的自訂文字。 此屬性通常與 屬性一起使用 NextMonthText ,以提供一組自訂導覽控制項。

注意

此屬性不會自動編碼為 HTML。 除非您希望將字元視為 HTML,否則您必須將特殊字元轉換成適當的 HTML 值。 例如,若要明確顯示大於符號 (>) ,您必須使用 值 &gt;

因為這個屬性不會自動編碼為 HTML,所以可以指定屬性的 PrevMonthText HTML 標籤。 例如,如果您想要顯示下個月導覽控制項的影像,您可以將此屬性設定為包含元素的 <img> 運算式。

只有當 屬性設定為 true 時, ShowNextPrevMonth 才會套用這個屬性。

當設定時,此屬性的值可以使用設計工具自動儲存到資源檔。 如需詳細資訊,請參閱 LocalizableAttributeASP.NET 全球化和當地語系化

適用於

另請參閱