There is nothing fancy with the mark-up:
<hr />
Add... <asp:Button ID="buttonTextSegment" runat="server" Text="Text Segment"
onclick="buttonTextSegment_Click" />
<hr />
Or the code:
protected void buttonTextSegment_Click(object sender, EventArgs e)
{
//never is triggered
}
My guess is that it is due to the hierarchy/load order:
In English: Inside the page's Load, it adds a user control. Inside of that user control, inside of Page_LoadComplete (is this the issue!?), it adds another user control, it is the inner-most user control that contains the mark-up button.
Pseudo Visually: Page -> Page_Load: Dynamically Added User Control -> Page_LoadComplete: Another Dynamically Added User Control -> User Control Mark-Up: Button with event.
Do events need to be hooked before LoadComplete? (Is there a way to make events still work even though the controls are added in LoadComplete?)