Calendar.DayNameFormat Właściwość

Definicja

Pobiera lub ustawia format nazwy dla dni tygodnia.

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

Wartość właściwości

DayNameFormat Jedna z wartości. Wartość domyślna to Short.

Atrybuty

Wyjątki

Określony format nazwy dnia nie jest jedną z DayNameFormat wartości.

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą DayNameFormat właściwości określić, że dni tygodnia są wyświetlane w całości.

<%@ 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>

Uwagi

DayNameFormat Użyj właściwości , aby określić format nazwy dla dni tygodnia. Ta właściwość jest ustawiana przy użyciu jednej z DayNameFormat wartości wyliczenia. Możesz określić, czy dni tygodnia są wyświetlane jako pełna nazwa, krótka (skrócona) nazwa, pierwsza litera dnia lub dwie pierwsze litery dnia.

Ta właściwość ma zastosowanie tylko wtedy, gdy właściwość jest ustawiona ShowDayHeader na truewartość .

Nazwy dni są oparte na ustawieniach lokalnych serwera.

Dotyczy

Zobacz też