int ob=0;
protected void Button1_Click(object sender, EventArgs e)
{
ob = Convert.ToInt32(Request.QueryString["value"].ToString());
if (RadioButton1.Checked == true)
{
ob = ob + 1;
}
else
{
ob = ob + 0;
}
Response.Redirect("result.aspx?value = " + ob);
}
例外: - System.NullReferenceException:「對象未設置 到對象的實例。」在asp.net使用的Request.QueryString重定向到另一個頁面asp.net
System.Collections.Specialized.NameValueCollection.this [string] .get 返回null。
可能重複[什麼是NullReferenceException,以及如何解決它?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-doi-i-fix -it) – VDWWD