Sample Example using MutuallyExclusiveCheckBoxExtender – AJAX ToolKit Control
Aspx Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MutuallyExclusiveCheckBoxExtender.aspx.cs" Inherits="Ajax_Controls_Examples_MutuallyExclusiveCheckBoxExtender" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Mutually Exclusive CheckBox Extender Control Example</title> </head> <body> <form id="form1" runat="server"> <div> <ajaxToolkit:ToolkitScriptManager ID="Sc1" runat="server"> </ajaxToolkit:ToolkitScriptManager> <asp:Label ID="lblText" runat="server" Text="Select an Option" ForeColor="Red" > </asp:Label> <br /><br /> <asp:CheckBox ID="CheckBox1" runat="server" Text="Hyderabad" /> <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="M1" runat="server" TargetControlID="CheckBox1" Key="Cities"> </ajaxToolkit:MutuallyExclusiveCheckBoxExtender> <br /> <asp:CheckBox ID="CheckBox2" runat="server" Text="Chennai" /> <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="M2" runat="server" TargetControlID="CheckBox2" Key="Cities"> </ajaxToolkit:MutuallyExclusiveCheckBoxExtender> <br /> <asp:CheckBox ID="CheckBox3" runat="server" Text="Bangalore" /> <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="M3" runat="server" TargetControlID="CheckBox3" Key="Cities"> </ajaxToolkit:MutuallyExclusiveCheckBoxExtender> <br /> <asp:CheckBox ID="CheckBox4" runat="server" Text="Delhi" /> <ajaxToolkit:MutuallyExclusiveCheckBoxExtender ID="M4" runat="server" TargetControlID="CheckBox4" Key="Cities"> </ajaxToolkit:MutuallyExclusiveCheckBoxExtender> <br /> </div> </form> </body> </html> |
Output:
No comments:
Post a Comment