Ask a Question related to ASP.NET General, Design and Development.
-
S. Justin Gengo #1
Re: event and templated control
Lloyd,
I think that the events are being "bubbled up" to your page.
You may want to read up on bubbling events.
I have some sample code on my web site, [url]www.aboutfortunate.com[/url], which shows
how to override the OnBubbleEvent. I'm using controls which are added to
placeholders on my page (similar to what you are doing) and if a button in
one of the controls is clicked I need to capture the event using the
OnBubbleEvent. If you search my code library for: "Bubble Event" or
something similar you'll find the listing easily.
(The code is in VB but it's pretty easy to understand and you could port it
to C# quite easily.)
Good luck!
--
S. Justin Gengo, MCP
Web Developer
Free code library at:
[url]www.aboutfortunate.com[/url]
"Out of chaos comes order."
Nietzche
"Lloyd Dupont" <lloyd@RemoveIfNotSpamming.galador.net> wrote in message
news:eNJrZJlXDHA.1644@TK2MSFTNGP10.phx.gbl...the> I have a page design with header, footer, sidebar and body.
> recently I wrote an web custom control (in C# only) to avoid copy paste> presentation code, I created a control like that
>
> [ParseChildren(true)]
> class PageTemplate : WebControl
> {
> [TemplateContainer(typeof(ElementContainer))]
> ITemplate Body {}
>
> [TemplateContainer(typeof(ElementContainer))]
> ITemplate Header {}
>
> [TemplateContainer(typeof(ElementContainer))]
> ITemplate Footer {}
>
> [TemplateContainer(typeof(ElementContainer))]
> ITemplate SideBar {}
> }
>
> I also override CreateChildControls() and OnDataBinding() as explained in
> the documentation.
>
> my problem is my events (when I click any links, buttons or whatever UI
> which will do a postback) do nothing since I use this template !
>
> could it be because I also override Render(HtemlTextWriter output) ?
> but in it I basically write plain HTML and some call to
> elementContainer.RenderControl(output);
>
>
S. Justin Gengo Guest
-
Custom Templated Databound Control or derived control?
Hi, I want to create a control that performs much like a datalist but I want more control over how the <ItemTemplate> contents is set out on the... -
Templated Custom Control
Greetings & Salutations, I have made a templated custom control (NOT data-bound), a container for the templates & a designer for the control.... -
Composite control delegating databound templated features to child <asp:repeater> control
Hi Everybody, I'm creating a composite control in C# that basically renders a bunch of webcontrols such as <asp:Label />, <asp:Repeater />,... -
templated control, need help starting
thanks john sorry, i didn't notice your other post. i'll check out the book neil "John Saunders" <john.saunders@surfcontrol.com> wrote in... -
templated control default
Hello, I've created a templated control in C#, and I am trying to have default values for templates if the user of the control does not specify....



Reply With Quote

