DISABLE SOME DATES IN CALENDAR CONTROL

Rajesh Goswami

Total Post:29

Points:203
Posted by  Rajesh Goswami
 2003  View(s)
Ratings:
Rate this:
I want to disable some dates in calendar control but can not find the suitable solution of its
please solve it
thanks in advance!
  1. Amit Singh

    Post:103

    Points:721
    Re: Disable some dates in Calendar control

    Hi rajesh

    Check this line of code on DayRender event on calendar control

    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
    {
        string date="08/24/2011";
        DateTime dt = DateTime.Parse(date);
        if (e.Day.Date == dt)
            e.Day.IsSelectable = false;
    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!