Calendar.DayNameFormat Свойство

Определение

Получает или задает формат названия дней недели.

public:
 property System::Web::UI::WebControls::DayNameFormat DayNameFormat { System::Web::UI::WebControls::DayNameFormat get(); void set(System::Web::UI::WebControls::DayNameFormat value); };
[System.ComponentModel.Bindable(true)]
public System.Web.UI.WebControls.DayNameFormat DayNameFormat { get; set; }
public System.Web.UI.WebControls.DayNameFormat DayNameFormat { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.DayNameFormat : System.Web.UI.WebControls.DayNameFormat with get, set
member this.DayNameFormat : System.Web.UI.WebControls.DayNameFormat with get, set
Public Property DayNameFormat As DayNameFormat

Значение свойства

Одно из значений перечисления DayNameFormat. Значение по умолчанию — Short.

Атрибуты

Исключения

Заданный формат названия дня не является значением DayNameFormat.

Примеры

В следующем примере кода показано, как использовать DayNameFormat свойство , чтобы указать, что дни недели отображаются полностью.

<%@ 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"
           ShowDayHeader="True"
           DayNameFormat="Full"/>
            
   </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"
           ShowDayHeader="True"
           DayNameFormat="Full"/>
            
   </form>
        

</body>
</html>
<%@ Page Language="C#"%>

<!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 runat="server">
    <title> Calendar DayNameFormat Example </title>
</head>
<body>
   <form id="form1" runat="server">
  
     <h3> Calendar DayNameFormat Example </h3>

     <asp:Calendar id="Calendar1"
       daynameformat="Shortest"
       runat="server"/>
       
    </form>
  </body>
</html>
<%@ Page Language="VB"%>

<!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 runat="server">
    <title> Calendar DayNameFormat Example </title>
</head>
<body>
   <form id="form1" runat="server">
  
     <h3> Calendar DayNameFormat Example </h3>

     <asp:Calendar id="Calendar1"
       daynameformat="Shortest"
       runat="server"/>
       
    </form>
  </body>
</html>

Комментарии

Используйте свойство , DayNameFormat чтобы указать формат имени для дней недели. Этому свойству присваивается одно из значений DayNameFormat перечисления. Можно указать, будут ли дни недели отображаться в виде полного имени, короткого (сокращенного) имени, первой буквы дня или первых двух букв дня.

Это свойство применяется только в том случае, если свойству ShowDayHeader присвоено значение true.

Названия дней основаны на локальных параметрах сервера.

Применяется к

См. также раздел