Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Events in custom controls
Message
From
10/10/2002 17:41:16
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Events in custom controls
Miscellaneous
Thread ID:
00710097
Message ID:
00710097
Views:
48
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
Reply
Map
View

Click here to load this message in the networking platform