Friday, April 16, 2010

How to disable future dates in Ajax Calender Extender Control


The following Code will help you to solve problem :

AjaxControlToolkit.CalendarBehavior.prototype._cell_onclick_original = AjaxControlToolkit.CalendarBehavior.prototype._cell_onclick;          
            AjaxControlToolkit.CalendarBehavior.prototype._cell_onclick = function(e)
            {                                   
                var target = e.target;                                              
                if(target.id.toLowerCase().indexOf('sdate') > -1)
                {   
                    var today_date = new Date();                                   
                    if (target.date > today_date)                                         
                    {
                        this._selectedDateChanging=false;
                        return;                                           
                    }
                }
                this._cell_onclick_original(e);
            } 

 
In next post I will show how to change color of future  dates in calender extender control...

No comments:

Post a Comment