You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
To add a Calendar server control to a Web page, you write the following code fragment.
<asp:Calendar SelectionMode=”DayWeek” ID=”Calendar1″ runat=”server”> </asp:Calendar>
You need to disable the non-week days in the Calendar control.
What should you do?
A.
Add the following code segment to the Calendar1 DayRender event handler.
If e.Day.IsWeekend Then
Day.IsSelectable = False
End If
B.
Add the following code segment to the Calendar1 DayRender event handler.
If e.Day.IsWeekend Then
If Calendar1.SelectedDates.Contains(e.Day.[Date]) Then
Calendar1.SelectedDates.Remove(e.Day.[Date])
End If
End If
C.
Add the following code segment to the Calendar1 SelectionChanged event handler.
Dim list As New List(Of DateTime)()
For Each st As DateTime In TryCast(sender, Calendar).SelectedDates
If st.DayOfWeek = DayOfWeek.Saturday OrElse st.DayOfWeek = DayOfWeek.Sunday Then
list.Add(st)
End If
Next
For Each dt As DateTime In list
TryCast(sender, Calendar).SelectedDates.Remove(dt)
Next
D.
Add the following code segment to the Calendar1 DataBinding event handler.
Dim list As New List(Of DateTime)()
For Each st As DateTime In TryCast(sender, Calendar).SelectedDates
If st.DayOfWeek = DayOfWeek.Saturday OrElse st.DayOfWeek = DayOfWeek.Monday Then
list.Add(st)
End If
Next
For Each dt As DateTime In list
TryCast(sender, Calendar).SelectedDates.Remove(dt)
Next