All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
PHP安装问题:编译安装php5.2.0时出错解决方案_php资料_编程技术
delphi在文本文件中添加一行
十天学会ASP.net,第八天_.net资料_编程技术
SQL,Server,2008在商务智能上的三个优化_mssql学习_编程技术
LINQ体验(9)——LINQ,to,SQL语句之Insert、Update、Delete操作
ASP.NET实例:在ASP.NET中创建使用全球唯一标识符_[Asp.Net教程]
Sql,server2005中的SQLCMD工具使用_[SQL,Server教程]
随机显示图片的javascript网页特效源代码_JavaScript技术_编程技术
ASP.NET从零起步设计网站全过程(5)_[Asp.Net教程]
ASP.NET,2.0中动态修改页面标题_[Asp.Net教程]
Reading number is top 10 pictures
Lewd,it is too lewd.
含苞欲放的素颜美少女1
The real super beauty12
Black and white also sexy--YanLiu2
Rendez-vous Sleep with actress, three days to earn 600000
鸡也看毛片
From China fortress sora aoi2
日本小萝莉2
Poor doll, hand job was caught the currently in effect by his dad
29 the belle stars after bath figure5
Download software ranking
Ashlynn Video2
1400篇各类破解文章
Call Of Duty5
matrix1
艳兽都市
Sora aoi, the nurse, uniform ,nursing assistant
Tram sex maniac 2 (H) rar bag5
SP3 for SQL2000
asp.net技术内幕
ASP.NET.2.0.XML.高级编程(第3版)
delv published in(发表于) 2014/1/27 6:52:39 Edit(编辑)
轻松掌握Ajax.net系列教程十四:使用CalendarExtender_[Asp.Net教程]

轻松掌握Ajax.net系列教程十四:使用CalendarExtender_[Asp.Net教程]

轻松掌握Ajax.net系列教程十四:使用CalendarExtender_[Asp.Net教程]

本章主要介绍CalendarExtender的使用方法。CalendarExtender组件比.net原来自带的Calendar控件效果更Cool,使用方法也丰富了很多。


第一步:建立AJAX Control Toolkit Website


为了演示CalendarExtender丰富的使用方法,本例子一共使用了两个TextBox控件、一个Image控件和两个CalendarExtender组件。我会通过两个TextBox演示CalendarExtender两种不同的使用方法。我们将以上控件都拖进设计界面,代码如下:










runat="server" />


当然我们还需要准备一个简单的样式表,让Calendar显得更漂亮,具体代码如下所示:


.MyCalendar .ajax__calendar_container {
border:1px solid #646464;
background-color: lemonchiffon;
color: red;
}
.MyCalendar .ajax__calendar_other .ajax__calendar_day,
.MyCalendar .ajax__calendar_other .ajax__calendar_year {
color: black;
}
.MyCalendar .ajax__calendar_hover .ajax__calendar_day,
.MyCalendar .ajax__calendar_hover .ajax__calendar_month,
.MyCalendar .ajax__calendar_hover .ajax__calendar_year {
color: black;
}
.MyCalendar .ajax__calendar_active .ajax__calendar_day,
.MyCalendar .ajax__calendar_active .ajax__calendar_month,
.MyCalendar .ajax__calendar_active .ajax__calendar_year {
color: black;
font-weight:bold;
}

注意:以上样式套用了页面输出客户端后系统为Calendar自动生成的ID,大家不需要理解这部分代码,只需要按照相应的位置设置好风格就可以了。


第二步:设置CalendarExtender


由于我演示了CalendarExtender的两种用法,因此设置有两种,但差别不大,具体代码如下所示:



CssClass="MyCalendar" runat="server">



runat="server" TargetControlID="TextBox2" PopupButtonID="Image1">

CalendarExtender1是最基本用法,我们直接把它的TargetControlID设为TextBox1,当TextBox1获得焦点时,CalendarExtender1就会自动展开,直到TextBox1失去焦点为止。而CalendarExtender2的用法有些特别,它比CalendarExtender1多了个PopupButtonID属性,值为Image1。它指我们可以通过点击Image1来激活CalendarExtender2控件,但选择完日期后,值还是返回到TargerControl即TextBox2那里。当选择完日期后,CalendarExtender2会自动消失。同时我们还定义了时间的显示格式,Format="yyyy-MM-dd"。


OK,运行,效果如下图:



点击TextBox1后CalendarExtender1自动展开。




点击Image1后CalendarExtender2会自动展开,选择完日期后CalendarExtender2会自动消失,并且日期的显示格式是我们所指定的格式。


结束:


本章主要介绍了CalendarExtender的使用方法。作为Ajax.net的日期控件,CalendarExtender还有很多很炫的功能,这需要大家自行研究一一发掘出来。







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.