Hi All,
I have UI:-
<tdvalign="top"> From Date
<asp:TextBoxID="TextBox_from"runat="server"></asp:TextBox>
<asp:RequiredFieldValidatorID="RequiredFieldValidator2"ControlToValidate="TextBox_from"runat="server"ErrorMessage="*"ValidationGroup="reqleav"Display="Dynamic"></asp:RequiredFieldValidator>
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server"Format="yyyy/MM/dd" TargetControlID="TextBox_from"Enabled="True">
</ajaxToolkit:CalendarExtender>
</td>
Code Behind:-
List<DateTime> dtholidays = null; protected void calDT_DayRender(object sender, DayRenderEventArgs e) { if (dtholidays.Contains(e.Day.Date) || e.Day.IsWeekend) { e.Day.IsSelectable = false; } } private List<DateTime> GetPublicHolidays() { List<DateTime> list = new List<DateTime>(); //populate from database or other sources list.Add(new DateTime(2013, 01, 01)); list.Add(new DateTime(2013, 02, 02)); list.Add(new DateTime(2013, 02, 14)); list.Add(new DateTime(2013, 03, 02)); list.Add(new DateTime(2013, 03, 14)); list.Add(new DateTime(2013, 04, 02)); list.Add(new DateTime(2013, 04, 14)); list.Add(new DateTime(2013, 05, 02)); list.Add(new DateTime(2013, 05, 14)); list.Add(new DateTime(2013, 06, 02)); list.Add(new DateTime(2013, 06, 14)); list.Add(new DateTime(2013, 07, 02)); list.Add(new DateTime(2013, 07, 14)); list.Add(new DateTime(2013, 08, 02)); list.Add(new DateTime(2013, 08, 14)); list.Add(new DateTime(2013, 09, 02)); list.Add(new DateTime(2013, 09, 14)); list.Add(new DateTime(2013, 10, 02)); list.Add(new DateTime(2013, 10, 14)); list.Add(new DateTime(2013, 11, 02)); list.Add(new DateTime(2013, 11, 14)); list.Add(new DateTime(2013, 12, 02)); list.Add(new DateTime(2013, 12, 14)); return list; }
How to call calDT_DayRender using ajaxToolkit:CalendarExtender?
I know if using this method format:- <asp:Calendar ID="calDT" runat="server" ondayrender="calDT_DayRender"></asp:Calendar>; but i am looking for method ajaxToolkit:CalendarExtender.
Please advise.
Thank you.
Regards,
Micheale