we are creating an aptitude test software. here is the problem we are encountering.. help wud be appreciated

if (RadioButtonList1.SelectedValue == obj[2].ToString() || RadioButtonList11.SelectedValue != "")
{
int corr_ans = Convert.ToInt32(Session["corr_ans_count"]);
corr_ans += 1;
Session["corr_ans_count"] = corr_ans;
}
else
{
int wrong_ans = Convert.ToInt32(Session["wrong_ans_count"]);
wrong_ans += 1;
Session["wrong_ans_count"] = wrong_ans;
}

problem area : as v hav used "RadioButtonList1.SelectedValue" to check whether student has enterd the correct ans or not but "RadioButtonList1.SelectedValue" is holding "null" rather than d selected option from radio button list.even if v enter correct ans then also its taking all answers as wrong answers not giving the correct result. is there any other way to do this... ????

another problem: we are getting error at CONNECT.OPEN even if the connection string is correctly enterd.. ??

Many Thanks

use SelectedIndex.Value instead of SelectedValue directly.it will solve that issue.and regarding wrong answers i thinkthere might be error with your logic.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.