code behind:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
CheckBox chk = (CheckBox)sender;
if (chk.Checked)
{
Session[chk.UniqueID] = true;
}
else
{
Session.Remove(chk.UniqueID);
}
}
protected void CheckBox1_DataBinding(object sender, EventArgs e)
{
CheckBox chk = (CheckBox)sender;
chk.Checked = Session[chk.UniqueID] != null;
}
aspx:file: OnDataBinding="CheckBox1_DataBinding" >
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Pradeep ShetRank #595 · 4K reputationPosted May 4, 2016, 10:40 PM EDT