I have created a user control that will contain a table of LinkButtons (and other information). I create the table rows in another custom object and return a TableRowCollection with the link buttons in certain cells of these table rows.
In the code behind for the user control I created an event handler for the button click of these LinkButtons. I pass the user control into the method call to create the table rows (using "this") and then attempt to add the event handler to the "Click" of the LinkButton. For some reason, the event handler doesn't fire on a post back caused by this button. Any ideas as to what I could do to make this event fire?
Here is the code where I create the button and add the event handler:
LinkButton button = new LinkButton();
button.Text = movie.Title;
button.Click += new EventHandler(control.Link_Click);
button.CommandArgument = result.LocalID.ToString();
cell1.Controls.Add(button);
Where "control" is the user control passed in as a parameter and "Link_Click" is the event handler.
Thanks in Advance!