All,
I am having a problem with a custom control that I created. The controls appear both in design and runtime, but when I click on a button it seems like nothing is happening. I have included the event handling code below. Is the problem with the code below, or the webform that the control is on?
The code
CreateChildControls()
.... other code ....
Controls.Add(cmdSearch);
cmdSearch.Click += new EventHandler(cmdSearchClicked);
... other code ....
public event EventHandler Click;
void cmdSearchClicked(object sender, EventArgs e)
{
cmdSearch.ForeColor = System.Drawing.Color.Red;
}
protected virtual void OnClick(EventArgs e)
{
// Raise the event.
Click(this, e);
}
Thanks
Jim