Please describe a few more details about your question:
Is this your actual code copy-pasted from your program?
What are the value of your ERESPONSE1-4 parameters?
What behavior do you see?
What behavior do you expect?
Is only the focus a problem or also the enabled/disabled controls?
Without this information it is difficult to propose a solution as we are not mind readers.
However, if this is your program, I see a problem:
if (string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE1"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE4"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE3"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE2"].Value.ToString())) ;
{
The if contains 4 lines of conditions that are followed by a semicolon ";"
This completes your if with an empty body and the following block is executed regardless of the evaluation of the if conditions.
This is equivalent to this:
if (string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE1"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE4"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE3"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE2"].Value.ToString()))
{
}
{
So if your behavior is always the 1 fields are enabled and all others are disabled, try removing the ";" immediately after the if and see, if this solves your problem.
if (string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE1"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE4"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE3"].Value.ToString()) ||
string.IsNullOrEmpty(SqlCmd.Parameters["@ERESPONSE2"].Value.ToString()))
{