AjaxControlToolKit CalendarExtender(日历扩展控件)的使用方法

所属分类: 网络编程 / ASP.NET 阅读数: 1942
收藏 0 赞 0 分享
例子:只需要设置CalendarExtender的TargetControlID为需要显示日期的TextBox的ID即可以,textBox控件的readOnly属性设置为 false
主要代码:
复制代码 代码如下:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="True" EnableScriptLocalization="True">
</asp:ScriptManager>
<ajaxToolkit:CalendarExtender Format="yyyy-MM-dd" ID="CalendarExtender2"
runat="server" TargetControlID="TextBox1" >
</ajaxToolkit:CalendarExtender>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

CalendarExtender的 Format属性设置 时间的显示格式
另:PopupButtonID属性是设置一个button控件的ID 点击该控件则展开calendarExtender
如下:
复制代码 代码如下:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="True" EnableScriptLocalization="True">
</asp:ScriptManager>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" PopupButtonID="ImageButton1" >
</cc1:CalendarExtender>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:ImageButton ID="ImageButton1"
runat="server" />

ScriptManager的EnableScriptGlobalization属性 和EnableScriptLocalization属性设置为 true则 控件为中文
具体ScriptManager的属性方法还在学习中。
更多精彩内容其他人还在看

Asp.net中的mail的发送

Asp.net中的mail的发送
收藏 0 赞 0 分享

用ASP.Net实现文件的在线压缩和解压缩

用ASP.Net实现文件的在线压缩和解压缩
收藏 0 赞 0 分享

ASP.NET中文件上传下载方法集合

ASP.NET中文件上传下载方法集合
收藏 0 赞 0 分享

ASP.NET通过Remoting service上传文件

ASP.NET通过Remoting service上传文件
收藏 0 赞 0 分享

ASP.NET2.0服务器控件之Render方法

ASP.NET2.0服务器控件之Render方法
收藏 0 赞 0 分享

ASP.NET2.0 WebRource,开发微调按钮控件

ASP.NET2.0 WebRource,开发微调按钮控件
收藏 0 赞 0 分享

ASP.NET2.0新特性概述

ASP.NET2.0新特性概述
收藏 0 赞 0 分享

介绍几个ASP.NET中容易忽略但却很重要的方法函数

介绍几个ASP.NET中容易忽略但却很重要的方法函数
收藏 0 赞 0 分享

asp.net2.0如何加密数据库联接字符串

asp.net2.0如何加密数据库联接字符串
收藏 0 赞 0 分享

用.NET 2.0压缩/解压功能处理大型数据

用.NET 2.0压缩/解压功能处理大型数据
收藏 0 赞 0 分享
查看更多