locked
Calender Enable for Upcoming Three days. RRS feed

  • Question

  • User-1070822473 posted

    Hi Every One,

    I have one Calender Which End User can Enable to click Upcoming Three days else are disable ..
    please help me for this logic...

    thanks alot.

    Tuesday, August 9, 2011 10:40 PM

Answers

  • User1224194097 posted

    You can use Calendar OndayRender event to disable dates accordingly.

    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
    {
        if (!(e.Day.Date >= DateTime.Today && e.Day.Date <= DateTime.Today.AddDays(3)))
            e.Day.IsSelectable = false;
    }
    <asp:Calendar ID="Calendar1" runat="server" ondayrender="Calendar1_DayRender">
    </asp:Calendar>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 9, 2011 11:00 PM