Ask a Question related to ASP.NET Building Controls, Design and Development.
-
paululvinius@hotmail.com #1
Problems with Templated Databound control
Hi!
In my templated databound control (inherited from
CompositeDataBoundControl) I have one template and one string get/set
property. When CreateChildControls(IEnumerable dataSource, bool
dataBinding) is being called, the string property is sometimes set and
sometimes not.
I have figured out that if the templated contains any form controls
(TextBox, RadioButton etc.), CreateChildControls are called prior to
the string property is set. If the template on the other hand does not
contain any form controls (like only a Label), CreateChildControls are
called after the string property is set.
I need the string property to be set when CreateChildControls are
called, while it determines what default template to implement.
Why am I experiencing this behavior?
/Paul
paululvinius@hotmail.com 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... -
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.... -
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... -
Michael Hamrah #2
Re: Problems with Templated Databound control
How/where are you setting the String property? In the markup? It
sounds like when you declare a server control in the template, .NET
parses the control and tries to instantiate the template without
instantiating the parent control correctly. Either way, something in
the order of operations is incorrect. Is there a way to assign a
default value for the string property within the control?
[email]paululvinius@hotmail.com[/email] wrote:> Hi!
>
> In my templated databound control (inherited from
> CompositeDataBoundControl) I have one template and one string get/set
> property. When CreateChildControls(IEnumerable dataSource, bool
> dataBinding) is being called, the string property is sometimes set and
> sometimes not.
>
> I have figured out that if the templated contains any form controls
> (TextBox, RadioButton etc.), CreateChildControls are called prior to
> the string property is set. If the template on the other hand does not
> contain any form controls (like only a Label), CreateChildControls are
> called after the string property is set.
>
> I need the string property to be set when CreateChildControls are
> called, while it determines what default template to implement.
>
> Why am I experiencing this behavior?
>
> /PaulMichael Hamrah Guest



Reply With Quote

