hi,
basically your control has hidden the functionality of the button from the
page containing the control. if you want to access the events of the
button, then you can do 2 things:
in the control, make the button public, and then in the page you can
programatically access the button through the control, and add an event
handler to it as follows:
this.Control1.Button1.Click += new EventHandler(myButtonClick);
OR
you can create a new public event in the control called onButtonClick. this
event will be raised whenever the button click happens, so in a sense it is
'forwarding' the button click event to your new event. with this approach,
your page can use the declarative syntax you have posted below, without
needing to dig into the control to get the button and wire up and event to
it.
i hope this helps
tim
"tranky" <NO****@GRAZIE.itwrote in message
news:44***********************@reader3.news.tin.it ...
Hi boys..
...i've a question for you!
I've a custom control with a button.
Well...
I need to create that:
<mytagprefix:mytag runat="server" onButtonClick="Button_Click">
And in the code behind of this page, i find the Button_Click function.
Ok...
...but how to implements the onButtonClick event in the control side?
What i must do to obtain it?
Please reply me...
...thanx.
tranky