asp.net - How to hide and visible a Calendar programmatically

Show and hide Calendar programmatically
Calendar is an asp.net web server control. calendar server control displays the dates for one month at a time. users can click an individual date to select it. calendar control have a built in property to show or hide itself programmatically at run time.

calendar Visible property get or set a value indicating whether the calendar control rendered as UI in web browser. this Visible property value type is System.Boolean. if we set this property value to 'true' then the web page will display the calendar control in web browser. and if we set this Visible property value to 'false' then it will hide the calendar control from web browser. by using this property we can control the calendar visibility programmatically.

the following asp.net c# example code demonstrate us how can we show or hide a calendar control dynamically in an asp.net application web page.
CalendarVisible.aspx

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Drawing" %>

<!DOCTYPE html>

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e)
    { 
        if(!this.IsPostBack)
        {
            Calendar1.BackColor = Color.MediumSeaGreen;
            Calendar1.ForeColor = Color.Snow;
            Calendar1.BorderColor = Color.DarkGreen;
            Calendar1.TitleStyle.BackColor = Color.SeaGreen;
            Calendar1.DayHeaderStyle.BackColor = Color.DarkSeaGreen;
        }
    }
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        Calendar1.Visible = false;
        Label1.Text = "Calendar now hide.";
    }
    protected void Button2_Click(object sender, System.EventArgs e)
    {
        Calendar1.Visible = true;
        Label1.Text = "Calendar now visible.";
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to show, hide, visible Calendar programmatically</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Navy; font-style:italic;">Calendar Example: Visible</h2>
        <asp:Label 
             ID="Label1"
             runat="server"
             Font-Bold="true"
             Font-Italic="true"
             Font-Size="Large"
             ForeColor="Crimson"
             >
        </asp:Label>
        <br /><br />
        <asp:Calendar 
            ID="Calendar1"
            runat="server"
            >
        </asp:Calendar>
        <br />
        <asp:Button 
             ID="Button1" 
             runat="server"
             ForeColor="DarkGreen"
             Text="Hide Calendar"
             Height="45"
             OnClick="Button1_Click"
             Font-Bold="true"
             />
        <asp:Button 
             ID="Button2" 
             runat="server"
             ForeColor="DarkGreen"
             Text="Visible Calendar"
             Height="45"
             OnClick="Button2_Click"
             Font-Bold="true"
             />
    </div>
    </form>
</body>
</html>