tag attributes not showing up for events

K

KJ

I have developed some ascx controls using VS2005.

Some of these controls have public events. I would like to reference
these events by name as attributes in the tag of the control where it
is used.

For example, the control's code declares:

public event VoidIntDelegate OnAssetChosen;

When the control is used, I'd like this event to show up in the tag and
auto wire up the event:

<KJ:AssetChooser runat="server" ID="ac1"
OnAssetChosen="MyEventHandler"/>

But the complier doesn't like this. It carps that the attribute (of the
tag) is not valid. The interesting thing is that this does with with
properties. For example:

<KJ:AssetChooser runat="server" ID="ac1" MyProperty="AValue"/>

Anyone know how to make this work with events (without using the += C#
wiring up in the code of the caller)?

-TIA
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top