P
paul.hester
Hi all,
I have a custom server control that can contain one or more buttons.
I'm trying to expose an event handler as a property so that the buttons
can fire a click event when clicked. However, I'm getting the following
error:
Cannot create an object of type 'System.EventHandler' from its string
representation 'OnSubmit' for the 'OnSubmit' property.
My control's tag looks like this:
<stuff:MyControl OnSubmit="OnSubmit" Width="430"
runat="server">...</stuff:MyControl>
The property looks like this:
public EventHandler OnSubmit
{
get { return _onSubmit; }
set { _onSubmit = value; }
}
I've tried the property with and without a type converter without
success.
Any help would be much appreciated.
Thanks,
Paul
I have a custom server control that can contain one or more buttons.
I'm trying to expose an event handler as a property so that the buttons
can fire a click event when clicked. However, I'm getting the following
error:
Cannot create an object of type 'System.EventHandler' from its string
representation 'OnSubmit' for the 'OnSubmit' property.
My control's tag looks like this:
<stuff:MyControl OnSubmit="OnSubmit" Width="430"
runat="server">...</stuff:MyControl>
The property looks like this:
public EventHandler OnSubmit
{
get { return _onSubmit; }
set { _onSubmit = value; }
}
I've tried the property with and without a type converter without
success.
Any help would be much appreciated.
Thanks,
Paul