Your first Mistake is Naming, Dont use txt for Check Boxes. Search about naming user controls.
Click Here[
^]
Then you already had a condition for check the status of check box
if (txtIsPaid.Checked == true)
{
}
, and you are passing the value of check box text. You should pass the current status of the check box.
Correct the code as follows. But be sure to have good names, not txtIsPaid.And also empleave.IsPaid should be a bool variable.
protected void txtIsPaid_CheckedChanged(object sender, EventArgs e)
{
if (txtIsPaid.Checked == true)
{
EmployeeLeave empleave = new EmployeeLeave();
empleave.IsPaid = true;
}
else
{
EmployeeLeave empleave = new EmployeeLeave();
empleave.IsPaid = false;
}
}