zoukankan
html css js c++ java
MutuallyExlcusiveCheckBox控件
功能:
可以应用到页面中的CheckBox上,通过为一组CheckBox指定同样的Key,让它们拥有类似单选按钮组(Radio Button Group)的行为,即用户只能选择组中的某一项。与单选按钮组不同的是,这个由CheckBox组成的单选按钮允许取消选择,即不选择组中的任意一项,而传统的单选按钮组则无法实现这个功能。
属性:
Key:隶属于同一群组的复选框,必须具有独一的键值。
TargetControlID:目标控件ID值。
实例代码:
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
runat
="server"
>
<
title
>
Untitled Page
</
title
>
</
head
>
<
body
>
<
form
id
="form1"
runat
="server"
>
<
asp:ScriptManager
ID
="sm"
runat
="server"
/>
<
table
>
<
tr
>
<
td
colspan
="2"
>
外出旅游,您会携带‧‧‧
</
td
>
</
tr
>
<
tr
>
<
td
style
=" 165px"
>
会携带
</
td
>
<
td
style
=" 165px"
>
不会携带
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:CheckBox
ID
="chkBoxTakeCellPhone"
runat
="server"
Text
="手机"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxTakeCamera"
runat
="server"
Text
="相机"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxTakeMP3"
runat
="server"
Text
="MP3"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxTakeEraset"
runat
="server"
Text
="耳机"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxTakeNB"
runat
="server"
Text
="笔记本"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxTakeFlashDrive"
runat
="server"
Text
="随身听"
/><
br
/>
</
td
>
<
td
>
<
asp:CheckBox
ID
="chkBoxNotTakeCellPhone"
runat
="server"
Text
="手机"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxNotTakeCamera"
runat
="server"
Text
="相机"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxNotTakeMP3"
runat
="server"
Text
="MP3"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxNotTakeEraset"
runat
="server"
Text
="耳机"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxNotTakeNB"
runat
="server"
Text
="笔记本"
/><
br
/>
<
asp:CheckBox
ID
="chkBoxNotTakeFlashDrive"
runat
="server"
Text
="随身听"
/>
<
br
/>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
="2"
>
<
hr
/>
</
td
>
</
tr
>
</
table
>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeTakeCellPhone"
runat
="server"
TargetControlID
="chkBoxTakeCellPhone"
Key
="CellPhone"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeNotTakeCellPhone"
runat
="server"
TargetControlID
="chkBoxNotTakeCellPhone"
Key
="CellPhone"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<%
--
设定「相机」的互斥式复选框
--
%>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeTakeCamera"
runat
="server"
TargetControlID
="chkBoxTakeCamera"
Key
="PDA"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeNotTakePDA"
runat
="server"
TargetControlID
="chkBoxNotTakeCamera"
Key
="PDA"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<%
--
设定「MP3」的互斥式复选框
--
%>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeTakeMP3"
runat
="server"
TargetControlID
="chkBoxTakeMP3"
Key
="MP3"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeNotTakeMP3"
runat
="server"
TargetControlID
="chkBoxNotTakeMP3"
Key
="MP3"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<%
--
设定「耳机」的互斥式复选框
--
%>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeTakeEarset"
runat
="server"
TargetControlID
="chkBoxTakeEraset"
Key
="Eraset"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeNotTakeEarset"
runat
="server"
TargetControlID
="chkBoxNotTakeEraset"
Key
="Eraset"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<%
--
设定「笔记本」的互斥式复选框
--
%>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeTakeNB"
runat
="server"
TargetControlID
="chkBoxTakeNB"
Key
="NB"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeNotTakeNB"
runat
="server"
TargetControlID
="chkBoxNotTakeNB"
Key
="NB"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeTakeFlashDrive"
runat
="server"
TargetControlID
="chkBoxTakeFlashDrive"
Key
="FlashDrive"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
<
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
ID
="mecbeNotTakeFlashDrive"
runat
="server"
TargetControlID
="chkBoxNotTakeFlashDrive"
Key
="FlashDrive"
>
</
ajaxToolkit:MutuallyExclusiveCheckBoxExtender
>
</
form
>
</
body
>
</
html
>
运行结果:
查看全文
相关阅读:
shell-变量的数值运算let内置命令
shell-变量的数值运算符-计算双括号(())的使用
shell-批量修改文件名及扩展名多案例
shell-变量的字串应用技术
一个MVVM前端扩展器
测试一个mysql 悲观锁
spring rest项目提示Request method 'PUT' not supported Method Not Allowed 405 错误
Mysql 使用sql语句添加列,修改列默认值,添加类注释
理解java泛型中的 上界extend 下界super
mysql存储过程游标循环装载字符串SQL语句示例
原文地址:https://www.cnblogs.com/abcdwxc/p/950114.html
最新文章
netcore 3.1 This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32.
如何修改Git已提交的日志
c# 类型转换
git 部分命令
coverity 捕获 构建命令 vs
docker-CMD与ENTRYPOINT区别
Dockerfile-常用指令及使用
centos7 yum 安装nodejs、npm、cnpm、pm2、yarn
人生是梦
kubernetes-核心概念
热门文章
kubernetes-集群架构与组件
kubernetes-介绍与特性
shell-整数测试多范例多生产案例举例
shell-字符串多操作符综合实践多案例
shell-逻辑操作符讲解与文件条件测试多范例多生产案例
shell-字符串及整数操作符讲解与多实践
shell-添加条件测试的多种方法语法介绍与简单实战
shell-变量输入内置read命令详解
shell-变量的数值运算-bc-typeset-中括号等方法介绍
shell-变量的数值运算与特殊应用expr
Copyright © 2011-2022 走看看