我已经为这个问题尝试了几种解决方案,但都没有奏效。基本上,我有一张员工表,用户可以选择通过更新面板动态添加员工。每个员工都被添加为LinkBut ton ,此按钮将通过OnClick事件触发ajaxToolkit:modalpopupextender窗口,此窗口将显示员工详细信息。问题是当我点击员工姓名时,弹出窗口会显示,但细节不会。
这是我创建按钮并将其放入表中的代码:
LinkButton lbtn = new LinkButton();
lbtn.ID = employee_arry[i] + "_lbtn" + i;
lbtn.Text = employee_arry[i];
lbtn.Click += new EventHandler(this.employee_info);
lbtn.CausesValidation = false;
lbtn.Attributes.Add("runat", "server");
cell.Controls.Add(lbtn);
这是employee_info方法:
//the info will be pulled from the database…
public void employee_info(object sender, EventArgs e)
{
name.Text = "employee name";
dept.Text = "employee department";
jobt.Text = "employee job title";
email.Text = "employee email";
tel.Text = "employee telephone";
ModalPopupExtender1.Show();
}