How to disable to select Weekends(Saturday and Sunday) in Calendar control in asp.net?

By Super Man

How to disable to select Weekends(Saturday and Sunday) in Calendar control in asp.net?

and here is a solution for that :)


.aspx

<asp:Calendar ID="Calendar1" runat="server" ondayrender="Calendar1_DayRender">
</asp:Calendar>

Code-behind
    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
    {
        if (e.Day.IsWeekend)
        {
            e.Day.IsSelectable = false;
        }

    }

How to disable to select Weekends(Saturday and Sunday) in Calendar control in asp.net?  (1612 Views)