Calendar.FirstDayOfWeek 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Calendar 컨트롤의 첫째 요일 열에 표시할 요일을 가져오거나 설정합니다.
public:
property System::Web::UI::WebControls::FirstDayOfWeek FirstDayOfWeek { System::Web::UI::WebControls::FirstDayOfWeek get(); void set(System::Web::UI::WebControls::FirstDayOfWeek value); };
[System.ComponentModel.Bindable(true)]
public System.Web.UI.WebControls.FirstDayOfWeek FirstDayOfWeek { get; set; }
public System.Web.UI.WebControls.FirstDayOfWeek FirstDayOfWeek { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.FirstDayOfWeek : System.Web.UI.WebControls.FirstDayOfWeek with get, set
member this.FirstDayOfWeek : System.Web.UI.WebControls.FirstDayOfWeek with get, set
Public Property FirstDayOfWeek As FirstDayOfWeek
속성 값
FirstDayOfWeek 값 중 하나입니다. 기본값은 Default
이며, 시스템 설정에 지정된 날짜가 사용됨을 나타냅니다.
- 특성
예외
지정한 날짜가 FirstDayOfWeek 값이 아닌 경우
예제
다음 코드 예제에서는 속성을 사용하여 FirstDayOfWeek 첫째 날 열을 월요일로 설정하는 방법을 보여 줍니다.
<%@ 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"
FirstDayOfWeek="Monday"/>
</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"
FirstDayOfWeek="Monday"/>
</form>
</body>
</html>
<%@ 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" >
<script runat="server" >
void Selection_Change(Object sender, EventArgs e)
{
// Set the first day of the week.
Calendar1.FirstDayOfWeek = (FirstDayOfWeek)DayList.SelectedIndex;
}
</script>
<head runat="server">
<title> Calendar FirstDayOfWeek Example </title>
</head>
<body>
<form id="form1" runat="server">
<h3> Calendar FirstDayOfWeek Example </h3>
Select the first day of the week.
<br /><br />
<asp:Calendar id="Calendar1"
ShowGridLines="True"
ShowTitle="True"
runat="server"/>
<br /><br />
<table cellpadding="5">
<tr>
<td>
First day of the week:
</td>
</tr>
<tr>
<td>
<asp:DropDownList id="DayList"
AutoPostBack="True"
OnSelectedIndexChanged="Selection_Change"
runat="server">
<asp:ListItem> Sunday </asp:ListItem>
<asp:ListItem> Monday </asp:ListItem>
<asp:ListItem> Tuesday </asp:ListItem>
<asp:ListItem> Wednesday </asp:ListItem>
<asp:ListItem> Thursday </asp:ListItem>
<asp:ListItem> Friday </asp:ListItem>
<asp:ListItem> Saturday </asp:ListItem>
<asp:ListItem Selected="True"> Default </asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</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" >
<script runat="server" >
Sub Selection_Change(sender as Object, e As EventArgs)
' Set the first day of the week.
Calendar1.FirstDayOfWeek = CType(DayList.SelectedIndex, _
System.Web.UI.WebControls.FirstDayOfWeek)
End Sub
</script>
<head runat="server">
<title> Calendar FirstDayOfWeek Example </title>
</head>
<body>
<form id="form1" runat="server">
<h3> Calendar FirstDayOfWeek Example </h3>
Select the first day of the week.
<br /><br />
<asp:Calendar id="Calendar1"
ShowGridLines="True"
ShowTitle="True"
runat="server"/>
<br /><br />
<table cellpadding="5">
<tr>
<td>
First day of the week:
</td>
</tr>
<tr>
<td>
<asp:DropDownList id="DayList"
AutoPostBack="True"
OnSelectedIndexChanged="Selection_Change"
runat="server">
<asp:ListItem> Sunday </asp:ListItem>
<asp:ListItem> Monday </asp:ListItem>
<asp:ListItem> Tuesday </asp:ListItem>
<asp:ListItem> Wednesday </asp:ListItem>
<asp:ListItem> Thursday </asp:ListItem>
<asp:ListItem> Friday </asp:ListItem>
<asp:ListItem> Saturday </asp:ListItem>
<asp:ListItem Selected="True"> Default </asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</form>
</body>
</html>
설명
컨트롤의 FirstDayOfWeek 첫째 날 열 Calendar 에 표시할 요일을 지정하려면 이 속성을 사용합니다. 이 속성 중 하나를 사용 하 여는 FirstDayOfWeek 열거형 값입니다. 요일 또는 FirstDayOfWeek.Default
시스템 설정에 따라 날짜가 결정됨을 나타내는 요일을 지정할 수 있습니다.