< script type="javascript">
function DateMi(sender,chk)
{
var DateMinus;
var chkD;
var chkM;
var chkY;
//var cDate;
chkD=new Date().getDate();
chkM=new Date().getMonth();
chkY=new Date().getFullYear();
chkM++;
cDate=(chkD + "/" + chkM + "/" + chkY);
var selday;
var selmonth;
var selyear;
seldate = sender._selectedDate;
selday = seldate.getDate();
selmonth = seldate.getMonth();
selyear = seldate.getFullYear();
selmonth++;
seldate=(selday + "/" + selmonth + "/" + selyear);
if((selmonth <= chkM) && (selday < chkD ) && (selyear <= chkY))
{
chk=true;
return chk;
}
}
function checkDate1(sender,args)
{
if (DateMi(sender,true))
{
alert("You cannot select a day earlier than today!");
var txt=document.getElementById('txtDate1');
txt.value="";
}
}
< /script>
....
....
< body>
< form>
< table>
< tr>
< asp:TextBox ID="txtDate1" runat="server" BackColor="#E0E0E0">< /asp:TextBox>
< img id="cal" src="../images/date1.gif" />
< cc1:CalendarExtender ID="CalendarExtendPD1" runat="server" TargetControlID="txtDate1" Format="d/M/yyyy" PopupButtonID="cal" Enabled="True"
BehaviorID="CalendarExtendPD1" onclientdateselectionchanged="checkDate1">
< /cc1:CalendarExtender>
< /tr>
< /table>
< /form>
< /body