C
Charles A. Lackman
Hello,
I have created a User Control within Visual Studio and it contains a
button that allows the user to querry a database. I dynamically add
additional controls to the page based on the number of rows retured inside a
dataset. All works well, but I have noticed that the control is rendered
in the "Pre Render" event I loose the Control's events (i.e. button1.click).
Is there a way to render the controls in the "Pre Render" event and still
maintain the controls Events?
Dim HowMany as Int16 = 8
Dim MyControl(HowMany) As UserControl
MyControl(i) = LoadControl("ArtistControl.ascx")
Page.FindControl("Form1").Controls.Add(MyControl(i))
The Control Must be an array of controls because "HowMany" changes for each
page. If I load the control in the "Page Load" event the controls events
work. Is this a bug or am I missing something. I even added an Event
Handler to the control with no success.
Any Suggestions would be greatly appreciated,
Thanks,
Chuck
I have created a User Control within Visual Studio and it contains a
button that allows the user to querry a database. I dynamically add
additional controls to the page based on the number of rows retured inside a
dataset. All works well, but I have noticed that the control is rendered
in the "Pre Render" event I loose the Control's events (i.e. button1.click).
Is there a way to render the controls in the "Pre Render" event and still
maintain the controls Events?
Dim HowMany as Int16 = 8
Dim MyControl(HowMany) As UserControl
MyControl(i) = LoadControl("ArtistControl.ascx")
Page.FindControl("Form1").Controls.Add(MyControl(i))
The Control Must be an array of controls because "HowMany" changes for each
page. If I load the control in the "Page Load" event the controls events
work. Is this a bug or am I missing something. I even added an Event
Handler to the control with no success.
Any Suggestions would be greatly appreciated,
Thanks,
Chuck