不知道这是不是你要的效果
[URL=http://www.54geek.com/myaspx/1/default.aspx]http://www.54geek.com/myaspx/1/default.aspx[/URL]
关键部分的代码如下;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
Application[\"i\"] = 0;
Application[\"j\"] = 0;
Application[\"k\"] = 0;
}
}
protected void r1_CheckedChanged(object sender, EventArgs e)
{Application[\"i\"] = Convert.ToInt32(Application[\"i\"]) + 1;
this.Label1.Text = Application[\"i\"].ToString();}
protected void r2_CheckedChanged(object sender, EventArgs e)
{
Application[\"j\"] = Convert.ToInt32(Application[\"j\"]) + 1;
this.Label2.Text = Application[\"j\"].ToString();
}
protected void r3_CheckedChanged(object sender, EventArgs e)
{Application[\"k\"] = Convert.ToInt32(Application[\"k\"]) + 1;
this.Label3.Text = Application[\"k\"].ToString();
}
}
不知道这是不是你要的效果
[URL=http://www.54geek.com/myaspx/1/default.aspx]http://www.54geek.com/myaspx/1/default.aspx[/URL]
关键部分的代码如下;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
Application[\"i\"] = 0;
Application[\"j\"] = 0;
Application[\"k\"] = 0;
}
}
protected void r1_CheckedChanged(object sender, EventArgs e)
{Application[\"i\"] = Convert.ToInt32(Application[\"i\"]) + 1;
this.Label1.Text = Application[\"i\"].ToString();}
protected void r2_CheckedChanged(object sender, EventArgs e)
{
Application[\"j\"] = Convert.ToInt32(Application[\"j\"]) + 1;
this.Label2.Text = Application[\"j\"].ToString();
}
protected void r3_CheckedChanged(object sender, EventArgs e)
{Application[\"k\"] = Convert.ToInt32(Application[\"k\"]) + 1;
this.Label3.Text = Application[\"k\"].ToString();
}
}