int Correct = Convert.ToInt32(Session["Correct"].ToString());
int total = Convert.ToInt32(Session["Wrong"].ToString()) + Convert.ToInt32(Session["Correct"].ToString());
double dbMark = 100 * correct / total;
Response.Write(" " + total.ToString() + " " + dbMark.ToString());
when i run my problem can not function ~
Jaish MathewsPosted Apr 10, 2010, 12:38 AM
You didn't mention the error getting. I am seeing that you haven't your session variables set with some values. Please check below modified code. It's running.
Session["Correct"] = 90;
Session["Wrong"] = 10;
int correct = Convert.ToInt32(Session["Correct"].ToString());
int total = Convert.ToInt32(Session["Wrong"].ToString()) + correct;
double dbMark = 100 * correct / total;
Response.Write(" " + total.ToString() + " " + dbMark.ToString());