如何判断动态生成的button是否被点击
我在前台页面用Repeater控件动态生成了Button按钮,现在不知怎么判断用户点击的是那个按钮?
protected void btndownload_Click(object sender, EventArgs e)
{
foreach (RepeaterItem ri in this.Repeater2.Items)
{
Button btn = ri.FindControl("lbndown") as Button;
if ()//各位大侠,我想问问这个判断条件应该怎么来写
{
HiddenField hfId = ri.FindControl("HiddenFieldId") as HiddenField;
if (hfId != null)
{
string idstr = hfId.Value;
int id = int.Parse(idstr);
checkpwdById(id);
break;
}
}
}
}
------解决方案--------------------
Button s = sender as Button;
s就是点击的那个