I tried getting multiple checked checkbox value. But the checked select only works for a single checked box. If i check more than 1 select box, the response is 0 but if i check only one select box, it displays the id correctly.
protected void ImageButton3_Click(object sender, EventArgs e)
{
int id = 0;
int.TryParse(hfCheckedIds.Value, out id);
Session["DatakeyValue"] = id;
ClientScript.RegisterClientScriptBlock(this.GetType(), "", "alert('" + id + "')", true);
}
$(function () {
GetEmployees(1);
var checked = [];
$('[id*=chkSelect]').on('click', function () {
if ($(this).is(":checked")) {
checked.push($(this).closest('tr').find('td').eq(1).html());
} else {
checked.pop($(this).closest('tr').find('td').eq(1).html());
}
$('[id*=hfCheckedIds]').val(checked.join(','));
});
});
$(document).on("click", '.Pager .page', function () {
GetEmployees(parseInt($(this).attr('page')));
});
$(document).on('click', '.view', function () {
$('[id*=hfId]').val($(this).closest('tr').find('td').eq(1).html());
});