all groups > asp.net building controls > october 2003 >
You're in the

asp.net building controls

group:

Problems with asp:placeholder nested withing datalist


Problems with asp:placeholder nested withing datalist Chris Ericoli
10/31/2003 5:21:54 AM
asp.net building controls:
Hi,

I am wanting to add a usercontrol programatically to a placeholder's control
collection. The placeholder is coded within the ITEMTEMPLATE of a datalist.
The problem that I am facing, is that when I render the page, the
placeholder variable (that I have declared as per the ID of the placeholder
control), is throwing an error of object not set. When I do a watch on the
placeholder variable, it's value is NOTHING, implying that it has not been
tied to the actual control.

I have checked and rechecked to ensure that the variable name is the same as
the control's ID. I have tried creating other controls within the
ITEMTEMPLATE, and the same thing happens - they do not instantiate with the
page's render. I thought that perhaps they only instantiate once the
datalist item object is created, so inspected the state within the
datalist.itemcreated event - same thing.

Am slowly losing hope - any help would be great.

Cheers

Chris

Problems with asp:placeholder nested withing datalist Quicky
10/31/2003 7:39:19 AM
You're controls will be instranciated during the datalist
Event. Why don't you use controls.add() int the datalist
cell instead of a placeHolde ?

[quoted text, click to view]
AddThis Social Bookmark Button