非常常见的一个控件
效果如下:

默认calendar:
<asp:TextBoxrunat="server"ID="Date1"autocomplete="off"/>
<ajaxToolkit:CalendarExtenderID="defaultCalendarExtender"runat="server"TargetControlID="Date1"/>
注:需要设置的是
TargetControlID="Date1"。
带格式匹配的Calendar:
<asp:TextBoxrunat="server"ID="Date2"autocomplete="off"/>
<ajaxToolkit:CalendarExtenderID="customCalendarExtender"runat="server"TargetControlID="Date2"CssClass="MyCalendar"Format="MMMMd,yyyy"/>
注:需要设置的是
TargetControlID="Date2"。
Format="MMMM d, yyyy"
按钮Calendar:
<asp:TextBoxrunat="server"ID="Date5"/>
<asp:ImageButtonrunat="Server"ID="Image1"ImageUrl="~/images/Calendar_scheduleHS.png"AlternateText="Clicktoshowcalendar"/>
<ajaxToolkit:CalendarExtenderID="calendarButtonExtender"runat="server"TargetControlID="Date5"PopupButtonID="Image1"/>
注:需要设置的是
TargetControlID=" Date5"。
Format="MMMM d, yyyy"
PopupButtonID="Image1"
好玩的是:日历控件的选择年

和选择月的界面

本文介绍ASP.NET中如何使用日历控件,并展示了三种不同的实现方式:默认日历、带格式匹配的日历及带有按钮触发的日历。每种方式都详细说明了配置参数。
3529

被折叠的 条评论
为什么被折叠?



