hi,i have online exam paper,in that i have 30 questions with multiple options,each question have 4 multiple choice answers.My doubt is,if i didn't select any of one of the question,and i am going to the next question,then immediately,i want to display the error message as please select the 3rd question or 4th question,near question only,how it is possible to display the message?(i have 30 questions in a page)
my code is...........
if ((RadioButtonList1.SelectedValue) == dsCurrent.Tables[0].Rows[0]["CorrectOption"].ToString())
{
if (RadioButtonList1.SelectedValue == "")
{
sb.Append("1");
sb.Append(",");
}
i++;
SqlCommand cmd1 = new SqlCommand("insert into StudentExamFullResult (UserID,Question,SelectedOption,CorrectOption) values('"+Label32.Text+"','" + dsCurrent.Tables[0].Rows[0]["Question"].ToString() + "','" + RadioButtonList1.SelectedValue + "','" + dsCurrent.Tables[0].Rows[0]["CorrectOption"].ToString() + "')", con);
cmd1.ExecuteNonQuery();
}
else
{
f (RadioButtonList1.SelectedValue == "")
{
sb.Append("1");
sb.Append(",");
}
SqlCommand cmd1 = new SqlCommand("insert into StudentExamFullResult (UserID,Question,SelectedOption,CorrectOption) values('" +Label32.Text + "','" + dsCurrent.Tables[0].Rows[0]["Question"].ToString() + "','" + RadioButtonList1.SelectedValue + "','" + dsCurrent.Tables[0].Rows[0]["CorrectOption"].ToString() + "')", con);
cmd1.ExecuteNonQuery();
}
if ((RadioButtonList2.SelectedValue) == dsCurrent.Tables[0].Rows[1]["CorrectOption"].ToString())
{
if (RadioButtonList2.SelectedValue == "")
{
sb.Append("2");
sb.Append(",");
}
i++;
SqlCommand cmd2 = new SqlCommand("insert into StudentExamFullResult (UserID,Question,SelectedOption,CorrectOption) values('" + Label32.Text + "','" + dsCurrent.Tables[0].Rows[1]["Question"].ToString() + "','" + RadioButtonList2.SelectedValue + "','" + dsCurrent.Tables[0].Rows[1]["CorrectOption"].ToString() + "')", con);
cmd2.ExecuteNonQuery();
}
else
{
if (RadioButtonList2.SelectedValue == "")
{
sb.Append("2");
sb.Append(",");
}
SqlCommand cmd2 = new SqlCommand("insert into StudentExamFullResult (UserID,Question,SelectedOption,CorrectOption) values('" + Label32.Text + "','" + dsCurrent.Tables[0].Rows[1]["Question"].ToString() + "','" + RadioButtonList2.SelectedValue + "','" + dsCurrent.Tables[0].Rows[1]["CorrectOption"].ToString() + "')", con);
cmd2.ExecuteNonQuery();
}
manimala