<asp:TextBox runat="server" ID="TextBox1" MaxLength="10"></asp:TextBox><asp:ImageButton ID="ImageButton1" runat="server" SkinID="CalendarImageButton" OnClientClick="javascript:return false;" /><ajaxToolkit:CalendarExtender runat="server" TargetControlID="TextBox1" CssClass="ajaxToolkit-CalendarExtender" Format="MM/dd/yyyy" PopupButtonID="ImageButton1" id="CalendarExtender1" />

1.使用CalendarExtender控件的页面,必需包括Ajax Extensions控件ScriptManager
2.CalendarExtender控件的属性Format可定制日期显示格式,默认值为"d",显示为"1/25/2007".如果要定制日期格式为"2007-01-25",应使用字符串"yyyy-MM-dd",而不是"yyyy-mm-dd";
3.如上图所示,若想从TextBox控件中取到日期值,请保证TextBox控件的ReadOnly属性的值为"false",若设置为"true",将无法从TextBox控件中取到值.

4.注意TargetControlID, PopupButtonID的属性.

Ajax Toolkit 中的CalendarExtender控件

相关文章:

  • 2021-12-11
  • 2021-10-05
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-31
  • 2021-08-02
  • 2022-02-08
  • 2021-04-29
  • 2022-01-18
  • 2021-06-05
相关资源
相似解决方案