Ajax Control Toolkit:34个服务器端控件实例探索(1/2)

需积分: 0 0 下载量 145 浏览量 更新于2024-08-30 收藏 136KB PDF 举报
Ajax Control Toolkit 是一套强大的 ASP.NET AJAX 控件集合,它提供了丰富的交互式用户体验,特别是在无需刷新整个页面的情况下动态更新部分区域。本文档主要介绍了Ajax Control Toolkit 中的 34 个服务器端控件中的第一个,Accordion。Accordion 控件允许开发者创建一个类似折叠菜单的效果,用户可以选择性地查看其中的多个面板(AccordionPane),同时保持其他面板隐藏。 Accordion 的核心功能包括: 1. 单个面板显示:Accordion 一次仅显示一个面板,类似于QQ或Msn好友分类的折叠面板。 2. 动态切换:可以在后台代码中通过`SelectedIndex`属性控制哪个面板展开,提供了良好的交互体验。 3. 模板自定义:AccordionPane 内容可以包含任意Web元素,作为内容容器,并且支持自动大小调整,有`None`(推荐)、`LimitFill`等多种模式。 4. 行为管理:Accordion 的行为由`AccordionExtender`控制,如淡入淡出效果,通过`Behavior`对象进行操作。使用`$find()`查找控件时,推荐使用服务器端控件的`ClientID`属性来提高可维护性和自动化测试的准确性。 在实际应用中,需要注意以下几点: - 避免在`Accordion`与`Table`配合使用时,如果设置了`FadeTransitions`为`True`,可能会导致布局问题。 - 在AccordionPane模板中定义的`Content`部分应谨慎处理,可以包含各种Web元素。 - 使用`$find()`方法时,推荐使用`<%=MyAccordion.ClientID%>_AccordionExtender`这样的格式,而不是直接引用控件名称,以避免测试和维护上的困扰。 示例代码如下: ```javascript <script language="javascript"> // 获取AccordionExtender的行为实例 var behavior = $find('<%=MyAccordion.ClientID%>_AccordionExtender'); // 设置或获取淡入淡出效果 behavior.set_FadeTransitions(true); // 设置 var isFading = behavior.get_FadeTransitions(); // 获取 // 选择并展开特定的AccordionPane behavior.SelectedIndex = 1; // 展开索引为1的面板 </script> ``` Accordion控件是Ajax Control Toolkit中的一个重要组件,它简化了页面的交互设计,提高了用户体验。掌握其使用方法和注意事项对于提升Web应用程序的交互性和性能至关重要。接下来的文档会继续介绍其他33个控件,帮助开发者更深入地理解和应用Ajax Control Toolkit。

make for plat=atlas310 cross=aarch64-ascend310-linux-gnu- LDFLAGS=-Wl,--gc-sections -static -L/home/257916/server/test/v1.1/Trunk/build/../src/thirdpart/libs/atlas310 -L/home/257916/server/test/v1.1/Trunk/build/../lib/atlas310 -ldw -lbs -lpthread -lm EXTRA_CFLAGS=-DSVN_VERSION="\"64670"\" -I /net -DOSA_MODULE_NAME=Spectrum-Convert@64670 -DBUILD_DATE="\"Mon, 24 Jul 2023 19:48:54 +0800"\" CFLAGS=-D_GNU_SOURCE -I/home/257916/server/test/v1.1/Trunk/build/../include -I/home/257916/server/test/v1.1/Trunk/build/../src/base/include -I/home/257916/server/test/v1.1/Trunk/build/../src/base/test/include -I/home/257916/server/test/v1.1/Trunk/build/../src/decode/include -I/home/257916/server/test/v1.1/Trunk/build/../src/decode/test/include -I/home/257916/server/test/v1.1/Trunk/build/../src/fourier/include -I/home/257916/server/test/v1.1/Trunk/build/../src/fourier/test/include -I/home/257916/server/test/v1.1/Trunk/build/../src/include -I/home/257916/server/test/v1.1/Trunk/build/../src/service/include -I/home/257916/server/test/v1.1/Trunk/build/../src/service/test/include -I/home/257916/server/test/v1.1/Trunk/build/../src/draw/include -I/home/257916/server/test/v1.1/Trunk/build/../src/draw/test/include -I/home/257916/server/test/v1.1/Trunk/build/../tools/include -fPIC -ffunction-sections -fdata-sections -g -Wall -O1 -c -o ############################################################ mkdir -p /home/257916/server/test/v1.1/Trunk/build/../bin/atlas310 aarch64-ascend310-linux-gnu-g++ -o draw test/src/draw_pic_test.o -Wl,--gc-sections -static -L/home/257916/server/test/v1.1/Trunk/build/../src/thirdpart/libs/atlas310 -L/home/257916/server/test/v1.1/Trunk/build/../lib/atlas310 -ldw -lbs -lpthread -lm /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: Relocations in generic ELF (EM: 62) /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: Relocations in generic ELF (EM: 62) /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: Relocations in generic ELF (EM: 62) /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: Relocations in generic ELF (EM: 62) /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: Relocations in generic ELF (EM: 62) /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: Relocations in generic ELF (EM: 62) /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: Relocations in generic ELF (EM: 62) /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: Relocations in generic ELF (EM: 62) /opt/Atlas310-ascend/toolkit/toolchain/hcc/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: test/src/draw_pic_test.o: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status make[1]: *** [draw] Error 1 make[1]: Leaving directory `/home/257916/server/test/v1.1/Trunk/src/draw' make: *** [draw] Error 2

2023-07-25 上传