I have a module widget where I am calling out to a code file that handles some extra logic for the DynamicDetailContainer. I can access the containers databound events and even the controls within the LayoutTemplate just fine, but I am trying to figure out how one could get a click event for a button to fire.
I can successfully find the button within detailsContainer_DataBound, but any attempt to assign it a click event or command argument approach seems to be ignored. I am guessing I am too far into the page lifecycle at this point to do that?
I can move the button outside of the DynamicDetailsContainer and bind it that way just fine. Wondering how I could do this within the the control if possible?
Here is what I tried:
protected void detailContainer_DataBound(object sender, EventArgs e)
var container = sender as DynamicDetailContainer;
var button = (Button)container.Controls.FindControl("submitButton");
if (button != null) button.Click += button_Click; //This is not null
protected void button_Click(object sender, EventArgs e) //this is never reached