asp.net - Programmatically deselect a Calendar selected dates

How to deselect dates in Calendar control
CalendarDeselectDates.aspx

<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html>

<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        SelectedDatesCollection dates = Calendar1.SelectedDates;
        dates.Clear();
        Label1.Text = "Calendar dates deselected.";
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to deselect dates in Calendar control</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:DodgerBlue; font-style:italic;">
            How to deselect dates in Calendar control programmatically
        </h2>
        <hr width="600" align="left" color="LightBlue" />
        <asp:Label
            ID="Label1" 
            runat="server"
            Font-Size="Large"
            ForeColor="Crimson"
            Font-Italic="true"
            Font-Names="Comic Sans MS"
            >
        </asp:Label>
        <br /><br />
        <asp:Calendar
            ID="Calendar1" 
            runat="server"
            NextPrevFormat="FullMonth"
            SelectionMode="DayWeekMonth"
            SelectMonthText="Month"
            SelectWeekText="Week"
            ForeColor="WhiteSmoke"
            DayNameFormat="Full"
            Font-Names="Book Antiqua"
            Font-Size="Medium"
            >
            <DayHeaderStyle
                 BackColor="DodgerBlue"
                 />
            <DayStyle
                 BackColor="BlueViolet"
                 BorderColor="DarkOrchid"
                 BorderWidth="1"
                 Font-Bold="true"
                 Font-Italic="true"
                 />
            <NextPrevStyle
                 Font-Italic="true"
                 Font-Names="Arial CE"
                 />
            <SelectedDayStyle
                 BackColor="DarkGreen"
                 BorderColor="SpringGreen"
                 />
            <SelectorStyle
                 BackColor="BlueViolet"
                 ForeColor="Snow"
                 Font-Names="Times New Roman Greek"
                 Font-Size="Small"
                 BorderColor="DarkOrchid"
                 BorderWidth="1"
                 />
            <TitleStyle
                 BackColor="Navy"
                 Height="35"
                 Font-Size="Large"
                 Font-Names="Courier New Baltic"
                 />
        </asp:Calendar>
        <asp:Button 
            ID="Button1"
            runat="server"
            Text="Deselect Dates"
            Font-Bold="true"
            OnClick="Button1_Click"
            ForeColor="DarkBlue"
            Height="45"
            />
    </div>
    </form>
</body>
</html>
More asp.net examples