I’ve tried several solutions for this problem but none of them worked. Basically, I have a table of employees and the user have the choice of adding an employee dynamically thru an update panel. Each employee is being added as LinkButton and this button will fire ajaxToolkit:modalpopupextender window through OnClick event, and this window will show the employee details. The problem is when I click on the employee name the popup window will show up BUT the details wont.
Here is the code in which I’m creating the buttons and putting it in the table:
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);
and here is the employee_info method:
//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();
}
See Question&Answers more detail:os