Create Web User Control with events visible in designer

L

lupina

Hi

I'm making web user control in ASP .NET 2.0 (TextBox + Button). It works
allright, but I need to add property and event to it, that would be visible
in VS Designer.
With property I havn't any troubles:

using System.ComponentModel;

private string message;
[Category("New"),Browsable(true)]
public string Message
{
set { this.message = value; }
get { return this.message; }
}


but, when I add event, it isn't visible in designer:

[Category("New"), Browsable(true)]
public event EventHandler Check;

protected void OnCheck(EventArgs e)
{
if (Check != null)
{
Check(this, e);
}
}

protected void ButtonCheck_Click(object sender, EventArgs e) // button
in my user control
{
OnCheck(e);
}

When I click on propeties of myUserControl (added to page) - I can't see any
events (lightning is invisible).
What I did wrong, and why I see property, but can't see event?



PS: when I do the same control but as WindowsControlLibrary, and next add to
windows form, I see my new added event without any troubles.
( but my control inherits from uciLabelPlusI :
System.Windows.Forms.Label)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top