Proprietà VisibleDate

Imposta o restituisce una data che specifica il mese da visualizzare. Presenta la stessa funzionalità della proprietà Calendar.VisibleDate di Web Form. Il valore predefinito è System.DateTime.MinValue.

public DateTime VisibleDate {
   get,
   set
}

Osservazioni

La proprietà VisibleDate viene aggiornata dopo la generazione dell'evento VisibleMonthChanged.

La data può essere qualsiasi giorno del mese. Viene utilizzato solo il valore del mese dell'oggetto DateTime.

Esempio

Nell'esempio che segue viene illustrato come utilizzare la proprietà VisibleDate per impostare le date visibili nel calendario.

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 that you want visible in the
   ' calendar.
   Calendar1.FirstDayOfWeek = WebControls.FirstDayOfWeek.Friday
   Calendar1.VisibleDate = DateTime.Parse("6/5/2001")

End Sub

[C#]

protected void Page_Load(Object sender, EventArgs e)
{
   Calendar1.ShowDayHeader = true;
   // Sets the first day of the week that you want visible in the
   // calendar.
   Calendar1.FirstDayOfWeek = WebControls.FirstDayOfWeek.Friday;
   Calendar1.VisibleDate = DateTime.Parse("6/5/2001");
}

Vedere anche

Si applica a: classe Calendar