Last post Sep 11, 2008 03:39 PM by Joseph Baggett
Sep 10, 2008 02:14 PM|Joseph Baggett|LINK
I am trying to mimic the UpdatePanel ContentTemplate section(I looked at it in reflector and still can't figure it out). Basically, you still have your reference to your controls in your ContentTemplate tag
//Controls still have visibility here without doing FindControl like in a repeater
I have create my own custom template:
//My problem is the controls inside of here are seen like a repeater and are not distinct controls I have access to, basically they are not seen in the control collection, but they show up as child controls of the ControlExtender
Here are the attributes I put at the top of the web control:
Am I missing an attribute? Wrong attribute?
Sep 10, 2008 03:42 PM|Peter Bucher|LINK
Yep, you`ll need to add at a PersistenceMode-Attribute:
Sep 10, 2008 04:18 PM|Joseph Baggett|LINK
I did add the PersistenceMode attribute to the ITemplate.
Here is what I would want to render:
//Controls, but not inner controls of HtmlFormTemplate
span. Right now, if I set the ParseChildren to false, the child control are not within the span... but defeats the purpose b/c the span is not generated(parsed). I'm trying to figure out how to maintain the children w/o losing them inside of the parent ITemplate.
The UpdatePanel is a prime example, it wraps up all the controls, but you don't need to do a FindControl to get a reference to controls within the template.
Thanks for the suggestion, still looking for the answer.
Sep 11, 2008 03:39 PM|Joseph Baggett|LINK
I have the web control implementing ITemplate with the attributes:
The ITemplates properties have these attributes:
Instead of building the templates on CreateChildControls, I am adding the templates on OnInit now, which allow the controls inside of the template to "exist" in the control collection. The controls are not null, but it is weird, I have a
Anyone see a timing issue and/or an error on my part?