G
Greg
I have an ascx web user control that has a button and listbox. I want to be able to expose the click event of the button and return the selected value in the listbox to the aspx page that uses the control. Or, I could capture the click event by the aspx page and expose the selected item property of the listbox. I was having problems just capturing the event on the aspx page and I think it's because the control is being loaded dynamically (I think the control is being lost on postback and the control is reloaded only after the click event tried to fire???). The aspx page might be loading 0 to unlimited number of these controls, one after another ... so what I did was add the eventhandler immediately after I added each control instead of in the OnInit event. Now, the page hits the event, but it always thinks that the event is being triggered by the last-loaded control. Can anyone help or at least point me in the right direction? Do I need to build a control collection of some sort and just add that control collection to the aspx page? How would I go about that?