O
Oisin Grehan
Hi,
I have a UserControl derived class:
<ns:votingbutton runat="server" id="btn1" onclick="votingbuttonclick" />
My question is, what code do I need in place in the codebehind for this to
be wired up? All the examples I've seen wire up the event programatically,
thus making this declarative attribute irrelevant. e.g.
btn1.click += new EventHandler(this.votingbuttonclick);
I've been looking at reflection and the control's Attribute collection, but
this looks awfully messy? I've tried using reflector to reverse engineer how
the stock webcontrols do it, but I just can't see it. I figure an attribute
hint is needed on an onclick property perhaps, but I can't find anything
that'll do the job?
Any hints?
- Oisin
I have a UserControl derived class:
<ns:votingbutton runat="server" id="btn1" onclick="votingbuttonclick" />
My question is, what code do I need in place in the codebehind for this to
be wired up? All the examples I've seen wire up the event programatically,
thus making this declarative attribute irrelevant. e.g.
btn1.click += new EventHandler(this.votingbuttonclick);
I've been looking at reflection and the control's Attribute collection, but
this looks awfully messy? I've tried using reflector to reverse engineer how
the stock webcontrols do it, but I just can't see it. I figure an attribute
hint is needed on an onclick property perhaps, but I can't find anything
that'll do the job?
Any hints?
- Oisin