AjaxControlToolKit CalendarExtender(日历扩展控件)的使用方法
AjaxControlToolKit CalendarExtender(日历扩展控件)的使用方法
发布时间:2016-12-29 来源:查字典编辑
摘要:例子:只需要设置CalendarExtender的TargetControlID为需要显示日期的TextBox的ID即可以,textBox控...

例子:只需要设置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教程学习
热门asp.net教程学习
编程开发子分类