problems with Button Events in dynamic usercontrols

Joined
Oct 3, 2006
Messages
1
Reaction score
0
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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top