Image1.Visible = true;
Label2.Text = "Correct Ans = " + answer.ToString();
Label3.Text = "Incorrect Ans = " + wrong.ToString();
Label20.Text = "Total Questions = " + count.ToString();
Label21.Text = "Score = " + answer* 10;
Label26.Text = "Percentage = " + Math.Round(answer / count* 100)+ " %";
answer = 0;
wrong = 0;
答案 0 :(得分:0)
有很多不同的方法可以实现这一目标。我建议您阅读A Beginner's Tutorial on ASP.NET State Management并确定哪一种最适合您
这是一个使用其中三种技术的简单示例,即:
string name = txtName.Text;
//1.Session
Session["name"] = name;
//2.Cookies
Response.Cookies["name"].Value = name;
Response.Cookies["name"].Expires = DateTime.Now.AddDays(1);
//3.Query strings
Response.Redirect("Page2.aspx?name=" + name);
//1.Session
string nameFromSession = Session["name"] as string;
//2.Cookies
string nameFromCookie = Request.Cookies["name"].Value;
//3.Query strings
string nameFromQueryString = Request.QueryString["name"];