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
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