<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="CalendarExtenderPlus" Namespace="AjaxControlToolkitPlus" TagPrefix="ajaxToolkit" %>
<form id="form1" runat="server">
Restrict the calendar to only allow selection of the current date only not previous date and next Date.
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:TextBox ID="txtTimeIn" runat="server" AutoPostBack="true"></asp:TextBox> <ajaxToolkit:CalendarExtender ID="Calendar1" ClientIDMode="AutoID" runat="server" Format="dd/MM/yyyy" TargetControlID="txtTimeIn">
</ajaxToolkit:CalendarExtender>
</ajaxToolkit:CalendarExtender>
</form>
C# Code
Calendar1.StartDate = DateTime.Today;
Calendar1.EndDate = DateTime.Today;
If Calander in Girdview then use on Row Data Bound
protected void Girdview1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
(e.Row.FindControl("Calendar1") as AjaxControlToolkit.CalendarExtender).StartDate = DateTime.Today;
(e.Row.FindControl("Calendar1") as AjaxControlToolkit.CalendarExtender).EndDate = DateTime.Today;
}
}