Share via


FirstDayOfWeek Property

Sets or returns the day of the week to display in the first column of a calendar. This property functions the same way as the System.Web.UI.WebControls.Calendar.FirstDayOfWeek property. The default value for the first day of the week is Default.

public System.Web.UI.WebControls.FirstDayOfWeek FirstDayOfWeek {
   get,
   set
}

Remarks

In the ASP.NET API, the FirstDayOfWeek enumeration contains every day of the week, with the enumeration of default returning the server's local setting for the first day of the week.

Example

The following example demonstrates how to use the FirstDayOfWeek property to set Friday as the first day of the week.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   
   calendar1.ShowDayHeader = True
   ' Sets the first day of the week you want to see in calendar.
   calendar1.FirstDayOfWeek = WebControls.FirstDayOfWeek.Friday
   calendar1.VisibleDate = DateTime.Parse("6/5/2001")

   
End Sub

[C#]
private void Page_Load(Object sender, EventArgs e)
{
   calendar1.ShowDayHeader = true;
   // Sets the first day of the week you want to see in calendar.
   calendar1.FirstDayOfWeek = WebControls.FirstDayOfWeek.Friday;
   calendar1.VisibleDate = DateTime.Parse("6/5/2001");
}

See Also

Applies to: Calendar Class