asp.net如何取前台值
protected void rplunch_ItemCommand(object source, RepeaterCommandEventArgs e)
{
foreach (RepeaterItem item in rplunch.Items)
{
TextBox txtnum = (TextBox)item.FindControl("num");
s += txtnum.Text;
}
}
//button click:
int sum = 0;
foreach (RepeaterItem item in rplunch.Items)
{
TextBox txtnum = (TextBox)item.FindControl("num");
sum += int.Parse(txtnum.Text);
}
Response.Write(sum);