protected void btnDelete_Click(object sender, EventArgs e) { Button bt = (Button)sender;//把button按钮作为事件转化为button int userid = Convert.ToInt32(((HiddenField)(bt.Parent.FindControl("HiddenField2"))).Value); if (UserInfoManager.DeleteID(userid) > 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language='javascript' >alert('删除成功!');</script>"); BindUsers();//执行完后重新绑定数据 } }