{
dt =HttpContext.Current.Session["Answered"] as DataTable;
foreach(DataRow row in dt.Rows)
{
if(row["Id"].ToString()==Label2.Text)
{
row["Selected"]=Convert.ToInt32(RadioButtonList1.SelectedIndex)+1;
HttpContext.Current.Session["Result"] = dt;
}
}
dt = HttpContext.Current.Session["Result"] as DataTable;
foreach (DataRow row in dt.Rows)
{
if (row["Selected"].ToString() == row["CorrectOption"].ToString())
{
marks = marks + 1;
}
}
HttpContext.Current.Session["Marks"] = marks;
}