Hello There!
I have a usercontrol named A that displays data from a database. I create a dynamic number of usercontrols depending on the number of hits from the database given a certain critera. If I receive 4 datasets from the database I create 4 usercontrols and so on…
These Usercontrols contains repeater objects displaying the data aswell as a button that interact with the data. Im now experiencing some major problems to get these buttons to fire once pressed.
I do believe I have done it the right way.
Usercontrol A
1. Initialize
2. declare Click method
It works perfect using static usercontrols, but not in this dynamic case. It wont even enter the OpenButton_click method in debug mode.
Is the EventHandler passing the event to the main app or what is happening.?!? Nothing what so ever happens..
Please help me Experts-Number-One, you are my only hope….
/Peter
I have a usercontrol named A that displays data from a database. I create a dynamic number of usercontrols depending on the number of hits from the database given a certain critera. If I receive 4 datasets from the database I create 4 usercontrols and so on…
These Usercontrols contains repeater objects displaying the data aswell as a button that interact with the data. Im now experiencing some major problems to get these buttons to fire once pressed.
I do believe I have done it the right way.
Usercontrol A
1. Initialize
2. declare Click method
Code:
private void InitializeComponent()
{
this.OpenButton.Click += new System.EventHandler(this.Open_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
Code:
protected void OpenButton_Click(object sender, System.EventArgs e)
{
//Log activity
}
It works perfect using static usercontrols, but not in this dynamic case. It wont even enter the OpenButton_click method in debug mode.
Is the EventHandler passing the event to the main app or what is happening.?!? Nothing what so ever happens..
Please help me Experts-Number-One, you are my only hope….
/Peter