Answers

Question and Answer:

  Home  Microsoft Web Forms

⟩ How to select multiple non-sequential dates at Code-Behind in Microsoft web forms?

Invoke the member function ‘Add’ of the control's SelectedDates collection. You can add dates in any sequence, because the collection will automatically arrange them in order for you.

protected void Calendar1_SelectionChanged(object sender, EventArgs e)

{

Calendar1.SelectedDates.Clear();

Calendar1.SelectedDates.Add(new DateTime(2008, 8, 1));

Calendar1.SelectedDates.Add(new DateTime(2008, 8, 7));

Calendar1.SelectedDates.Add(new DateTime(2008, 8, 15));

}

 218 views

More Questions for you: