I'm a Beginner. I'm using a CheckBoxList for my Quiz. I want Values 1-4 to be the Correct answer and 5 to be Incorrect. Then have the results display OnClick through my Results label. Such that:
- Fashion & Design Club (Correct)
- Fishing Club (Correct)
- Dance Club (Correct)
- Art Club (Correct)
- NONE (Incorrect)
No matter what, if 1-4 is included with 5 I want the answer to be Incorrect. How do I do that? I tried using an If statement I'm finding that this clearly isn't going to work.
My Code:
protected void SubmitButton_Click(object sender, ImageClickEventArgs e)
{
if (CheckBoxList1.SelectedValue == "1")
{
Results.Text += " <br> Question 4 is Correct. <br>";
}
else if (CheckBoxList1.SelectedValue == "5")
{
Results.Text += " Question 4 is Incorrect. <br>";
}
}