Calendar.DayNameFormat Vlastnost

Definice

Získá nebo nastaví formát názvu pro dny v týdnu.

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

Hodnota vlastnosti

DayNameFormat

Jedna z DayNameFormat hodnot. Výchozí hodnota je Short.

Atributy

Výjimky

Zadaný formát názvu dne není jednou z DayNameFormat hodnot.

Příklady

Následující příklad kódu ukazuje, jak použít DayNameFormat vlastnost k určení, že dny v týdnu jsou zobrazeny v plném rozsahu.

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

Poznámky

DayNameFormat Vlastnost slouží k určení formátu názvu pro dny v týdnu. Tato vlastnost je nastavena s jednou z hodnot výčtu DayNameFormat . Můžete určit, jestli se dny v týdnu zobrazují jako celé jméno, krátké (zkrácené) jméno, první písmeno dne nebo první dvě písmena dne.

Tato vlastnost se vztahuje pouze v případě, že ShowDayHeader je vlastnost nastavena na true.

Názvy dnů jsou založené na místním nastavení serveru.

Platí pro

Viz také