Embed your checkboxes within the <asp:UpdatePanel>
element:
<asp:UpdatePanel runat="server" ID="updatePanel">
<ContentTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Text="Checkbox 1" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="true" />
<asp:CheckBox ID="CheckBox2" runat="server" Text="Checkbox 2" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="true" />
</ContentTemplate>
</asp:UpdatePanel>
Back-end code:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
lblResults.Text = String.Empty;
if (CheckBox1.Checked)
lblResults.Text = "Checkbox 1.";
if (CheckBox2.Checked)
lblResults.Text += "Checkbox 2.";
}
.ASPX file:
<head runat="server">
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script type="text/javascript">
$(function () {
$('#messageBox').modal('show');
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="modal fade" id="messageBox" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal</h4>
</div>
<div class="modal-body">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel runat="server" ID="updatePanel">
<ContentTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Text="Checkbox 1" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="true" />
<asp:CheckBox ID="CheckBox2" runat="server" Text="Checkbox 2" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="true" />
<asp:Label runat="server" ID="lblResults" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</form>
</body>