Author: mhson1978 | Posted on: 1/13/2010 7:13:42 PM | Views : 304

I know this topic has been posted before but I'm stuck on it still.
I've placed creating of dynamic control on Page_Load but the event isn't firing.
On my asp page, i have <asp:PlaceHolder ID="test" runat="server/>
On my code behind, I have private display method.
private void DisplayButton() {
LinkButton btn = new LinkButton();
btn.ID="unit_1";
btn.Controls.Add(unitTitle); //unit Title is a label control
btn.Controls.Add(unitImage); //unit Image is image control
btn.Click += new System.EventHandler(this.ProcessClick); 
}
private void ProcessClick(Object sender, EventArgs e) {

LInkButton temp = (LinkButton)Sender;
txtLabe.Text = "Button ID: " + temp.ID.toString();
}

On my Page load, I have DisplayButton() method.
Problem is, the buttons are displayed correctly but when i click on it, it doesn't fire ProcessClick. What am ...

Go to the complete details ...