You can do it via ajax call. In your clientside function where you hide modal box before that fetch all the checkbox checked value using .each() jquery n then call ajax request and save it to ur database.
function HideModalPopup() {
var fetchAllChkbox= $("input[name=chkboxName]:ch ecked").map( function () {return this.value;}).get().join(",");
$find("mpe").hide();
// $.ajax call to save to database etc
return false;
}
Note- herechkboxName is name of chkboxss,
Updated Answer : Get all selected checkbox values in a variable and create cookie session and set selected value to it.
JQuery:
$(document).ready(function () {
$("#clkme").click(function () {
var getValue = ""; // get vall checkbox selected values
$("[id*=CheckBoxList1] input:checked").each(function () {
var Value = $(this).val();
getValue += Value + ",";
});
$.cookie('your_cookie_name', getValue); // set cookies
alert($.cookie('your_cookie_name')); // read cookies and alert it
});
});
HTml markup:
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
</asp:CheckBoxList>
<div id="clkme">CLICK ME</div>
Note: just import this cookie.js https://github.com/carhartl/jquery-cookie