.net3.5 和vs2008中Ajax控件的使用--CollapsiblePanel(可收缩面版)控件
2008-06-24 17:40
405 查看
一、属性
TargetControlID:该扩展器目标控件ID,即将要实现折叠、展开功能的控件的ID
ExpandControlID:指定一个服务器控件的ID,当用户点击该控件时,该扩展器的目标Panel控件将展开
CollapseControlID:指定一个服务器控件的ID,当用户点击该控件时,该扩展器的目标Panel控件将折叠
Collapsed:目标Panel控件的初始化状态,true代表折叠,false代表展开
TextLabelID:指定一个服务器Label控件的ID,用来显示此时目标Panel控件的折叠/展开状态
ImageControlID:指定一个服务器端Image控件的ID,用来告知用户此时目标Panel控件的折叠、展开状态
ExpandedText:当目标Panel控件为展开状态时,TextLabelID属性所指定的Label控件中的文字
CollapsedText:当目标Panel控件为折叠时,TextLabelID属性所指定的Label控件中的文字
ExpandedImage:当目标Panel控件为展开状态时,ImageControlID属性所指定的Image控件中图片的URL
CollapsedImage:当目标Panel控件为折叠状态时,ImageControlID属性所指定的Image控件中图片的URL
二、使用实例
a、新建Ajax Web 窗体,并命名为CollapsiblePanel.aspx
b、在页面上拖放两个Panel控件,代码如下:
c、为刚才建立的panel1控件添加CollapsiblePanel扩展程序
d、添加完扩展程序后,为CollapsiblePanel控件添加相关的属性来控制两个panel控件的使用,代码如下:
e、效果如下:
TargetControlID:该扩展器目标控件ID,即将要实现折叠、展开功能的控件的ID
ExpandControlID:指定一个服务器控件的ID,当用户点击该控件时,该扩展器的目标Panel控件将展开
CollapseControlID:指定一个服务器控件的ID,当用户点击该控件时,该扩展器的目标Panel控件将折叠
Collapsed:目标Panel控件的初始化状态,true代表折叠,false代表展开
TextLabelID:指定一个服务器Label控件的ID,用来显示此时目标Panel控件的折叠/展开状态
ImageControlID:指定一个服务器端Image控件的ID,用来告知用户此时目标Panel控件的折叠、展开状态
ExpandedText:当目标Panel控件为展开状态时,TextLabelID属性所指定的Label控件中的文字
CollapsedText:当目标Panel控件为折叠时,TextLabelID属性所指定的Label控件中的文字
ExpandedImage:当目标Panel控件为展开状态时,ImageControlID属性所指定的Image控件中图片的URL
CollapsedImage:当目标Panel控件为折叠状态时,ImageControlID属性所指定的Image控件中图片的URL
二、使用实例
a、新建Ajax Web 窗体,并命名为CollapsiblePanel.aspx
b、在页面上拖放两个Panel控件,代码如下:
<asp:Panel ID="Panel2" runat="server" Height="30px" CssClass="collapsePanelHeader"> <div style="padding:5px; cursor: pointer; vertical-align: middle;"> <div style="float: left; font-size:12px">What is ASP.NET AJAX?</div> <div style="float: left; margin-left: 20px;"> <asp:Label ID="Label1" runat="server" Font-Size="12px">(Show Details...)</asp:Label> </div> <div style="float: right; vertical-align: middle;"> <asp:ImageButton ID="Image1" runat="server" ImageUrl="~/images/expand_blue.jpg" AlternateText="(Show Details...)"/> </div> </div> </asp:Panel> <asp:Panel ID="Panel1" runat="server" Width="300px" Height="30px"> <p> <asp:ImageButton ID="Image2" runat="server" ImageUrl="~/images/AJAX.gif" AlternateText="ASP.NET AJAX" ImageAlign="right" /> ASP.NET AJAX is a free framework for building a new generation of richer, more interactive, highly personalized cross-browser web applications. This new web development technology from Microsoft integrates cross-browser client script libraries with the ASP.NET 2.0 server-based development framework. In addition, ASP.NET AJAX offers you the same type of development platform for client-based web pages that ASP.NET offers for server-based pages. And because ASP.NET AJAX is an extension of ASP.NET, it is fully integrated with server-based services. ASP.NET AJAX makes it possible to easily take advantage of AJAX techniques on the web and enables you to create ASP.NET pages with a rich, responsive UI and server communication. However, AJAX isn't just for ASP.NET. You can take advantage of the rich client framework to easily build client-centric web applications that integrate with any backend data provider and run on most modern browsers. </p> </asp:Panel>
c、为刚才建立的panel1控件添加CollapsiblePanel扩展程序
d、添加完扩展程序后,为CollapsiblePanel控件添加相关的属性来控制两个panel控件的使用,代码如下:
<cc1:CollapsiblePanelExtender ID="Panel1_CollapsiblePanelExtender" runat="server" Enabled="True" TargetControlID="Panel1" ExpandControlID="Panel2" CollapseControlID="Panel2" Collapsed="True" TextLabelID="Label1" ImageControlID="Image1" ExpandedText="(Hide Details...)" CollapsedText="(Show Details...)" ExpandedImage="images/collapse_blue.jpg" CollapsedImage="~/images/expand_blue.jpg" SuppressPostBack="true" SkinID="CollapsiblePanelDemo"> </cc1:CollapsiblePanelExtender>
e、效果如下:
相关文章推荐
- AJAX扩展控件CollapsiblePanel(可收缩面版)的使用方法总结
- net3.5 和vs2008中Ajax控件的使用--AjaxControlToolkit的安装
- VS2008中Ajax控件的使用--CollapsiblePanel控件(可收缩面版)
- 使用CollapsiblePanelExtender实现展开和收缩效果以及Accordion控件
- .net3.5 和vs2008中Ajax控件的使用--Accordion(可折叠)控件
- ★ AjaxControlToolkit 微软出的ajax.net 工具使用教程四 CollapsiblePanelExtender控件的使用
- CollapsiblePanelExtender这Ajax控件使用
- AjaxControlToolkit 微软出的ajax.net 工具使用教程四 CollapsiblePanelExtender(隐藏)控件的使用
- ASP.NET Ajax 控件之应用一(CollapsiblePanelExtender控件的使用)
- net3.5 和vs2008中Ajax控件的使用--AjaxControlToolkit的安装
- UpdatePanel控件的使用(实现局部刷新,ajax)
- 使用vs2008创建.net2.0时网站时,使用Ajax控件会提示:Microsoft JScript 运行时错误: 'Sys' 未定义解决方案
- altas(ajax)控件(七):CollapsiblePanel可折叠面板
- ajax中CollapsiblePanelExtender控件
- altas(ajax)控件(七):CollapsiblePanel可折叠面板
- .net3.5 和vs2008中Ajax控件的使用--Accordion(可折叠)控件
- .net3.5 和vs2008中Ajax控件的使用--AjaxControlToolkit的安装
- altas(ajax)控件(七):CollapsiblePanel可折叠面板
- .net3.5 和vs2008中Ajax控件的使用--Calendar(日历)控件
- ASP.NET AJAX入门系列:使用UpdatePanel控件(一)