MutuallyExclusiveCheckBox控制項實現複選框互斥功能
屬性列表:
TargetControlID:被控制控制項的ID
Key: 區分互斥複選框的索引值(兩個互斥複選框的要一樣)
執行個體解析一、簡單實現
1<form id="form1" runat="server">
2 <div>
3 <asp:ScriptManager ID="ScriptManager1" runat="server">
4 </asp:ScriptManager>
5
6 </div>
7 <asp:CheckBox ID="net" runat="server" Text="net" />
8 <asp:CheckBox ID="jsp" runat="server" Text="jsp" /><br />
9 <asp:CheckBox ID="aspnet" runat="server" Text="aspnet"/>
10 <asp:CheckBox ID="java" runat="server" Text="java" />
11 <cc1:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender1" runat="server"
12 Key="one" TargetControlID="net">
13 </cc1:MutuallyExclusiveCheckBoxExtender>
14 <cc1:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender2" runat="server"
15 Key="two" TargetControlID="jsp">
16 </cc1:MutuallyExclusiveCheckBoxExtender>
17 <cc1:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender3" runat="server"
18 TargetControlID="aspnet" Key="two">
19 </cc1:MutuallyExclusiveCheckBoxExtender>
20 <cc1:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender4" runat="server" TargetControlID="java" Key="one">
21 </cc1:MutuallyExclusiveCheckBoxExtender>
22 </form>