consmesuno
New Member
I have a boolean variable called CheckBoxActivated that I assign to true after validating a user name and password.\[code\]string name = us.UserName;string password = us.Password;if (name.Equals(txtName.Text) && (password.Equals(txtPassword.Text))){ CheckBoxAvtivated = true;\[/code\]The strange thing is,after assisgning 'true' to the variable I click another button and immediately it becomes 'false' which results in undesired behaviour.\[code\]protected void butNext_Click(object sender, EventArgs e){ if (CheckBoxAvtivated) { pnlCheckBoxes.Visible = true; pnlUserCheckBoxValidation.Visible = false; } else { pnlCheckBoxes.Visible = false; pnlUserCheckBoxValidation.Visible = true; }\[/code\]The state of the variable thus changes to false unexpectedly. Any reason why this could happen?