Have you added the button to the 'Controls' property of the custom-web
control?
How are you rendering the button?

Well, "runat" attribute is not to be sent to the client... it is processed
by ASP.Net Runtime. I think you need better understanding of HTML and
ASP.Net first.

anyway... some code that you wrote should be able to help you out in
resolving the problem..


--
Happy Hacking,
Gaurav Vaish | [url]www.mastergaurav.com[/url]
[url]www.edujini-labs.com[/url]
[url]http://eduzine.edujinionline.com[/url]
-----------------------------------------


"Simon" <Simon@discussions.microsoft.com> wrote in message
news:045F3E90-22BA-4746-9C84-F47569F87CA7@microsoft.com...
> Hey guys.
>
> I am learning how to write a custom web control and I am inheriting from
> System.Web.UI.WebControls.WebControl. I have created an instance of a
> Button
> class inside of this control and in the constructor of the control I have
> handled the Click event. When I click the button and it submits the page,
> the
> event doesn't fire.
>
> I want to be able to handle that click event and fire the parent controls
> click event so the developer using the control can handle appropriately.
>
> I am not sure what is stopping the event from firing. The function that
> receives the event isn't being executed. I then thought oh yeah I forgot
> to
> .Attributes.Add("runat", "server"); but that didn't make a difference.
>
> Any help would be greatly appreciated.
>
> Thanks and take care.