Raising Events on Loaded Custom Control
Posted on 2006-06-05
How do I capture the event on a custom control which has been loaded dynamically.
My control has the following code,
public event EventHandler Filter;
private void OnFilter()
if (Filter != null)
Filter(this, new EventArgs());
...and in the button click event:
protected void btnRefreshGrid_Click(object sender, EventArgs e)
if (Filter != null) Filter(this, new EventArgs());
The main page loads this control dynamically using:
So, how do I ensure that this loaded control has access to the OnFilter event in the control?
Thanks in advance,