Calendar.SelectWeekText 属性
定义
获取或设置为选择器列中周选择元素显示的文本。Gets or sets the text displayed for the week selection element in the selector column.
public:
property System::String ^ SelectWeekText { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
public string SelectWeekText { get; set; }
public string SelectWeekText { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.SelectWeekText : string with get, set
member this.SelectWeekText : string with get, set
Public Property SelectWeekText As String
属性值
为选择器列中周选择元素显示的文本。The text displayed for the week selection element in the selector column. 默认值为 ">" ,它呈现为大于符号 (>) 。The default value is ">", which is rendered as a greater than sign (>).
- 属性
示例
下面的代码示例演示如何使用 SelectWeekText 属性为 week 选择元素提供自定义文本。The following code example demonstrates how to use the SelectWeekText property to provide custom text for the week selection element.
<%@ 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"
SelectionMode="DayWeekMonth"
SelectMonthText="<*>"
SelectWeekText="->"/>
</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"
SelectionMode="DayWeekMonth"
SelectMonthText="<*>"
SelectWeekText="->"/>
</form>
</body>
</html>
注解
使用 SelectWeekText 属性为选择器列中的周选择元素提供自定义文本。Use the SelectWeekText property to provide custom text for the week selection element in the selector column.
备注
此属性不会自动编码为 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. 例如,若要显式显示大于符号 (>) ,必须使用值 > 。For example, to explicitly display the greater than symbol (>), you must use the value >.
由于此属性不会自动编码为 HTML,因此可以为属性指定 HTML 标记 SelectWeekText 。Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the SelectWeekText 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.
仅当 SelectionMode 属性设置为或时,此属性才适用 CalendarSelectionMode.DayWeek CalendarSelectionMode.DayWeekMonth 。This property applies only if the SelectionMode property is set to CalendarSelectionMode.DayWeek or CalendarSelectionMode.DayWeekMonth.
设置此属性后,可以使用设计器工具自动将此属性的值保存到资源文件中。The value of this property, when set, can be saved automatically to a resource file by using a designer tool. 有关详细信息,请参阅 LocalizableAttribute 和 ASP.NET 全球化和本地化。For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.