Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Events in custom controls
Message
De
10/10/2002 17:41:16
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Events in custom controls
Divers
Thread ID:
00710097
Message ID:
00710097
Vues:
49
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
Répondre
Fil
Voir

Click here to load this message in the networking platform