IMO it should work in both cases (does it ?)
I would say that the "first" control (usually a TR tag) "carries" the
"naming container" functionnality so that each row can have its own "Label1"
control....
I'm working on simialr things and for now never hard to deal with this (but
I'm using always RepeaterItem.Controls(0).FindControl("Name"))
Patrice
--
"P.L." <neuvedena> a écrit dans le message de
news:uy**************@TK2MSFTNGP12.phx.gbl...
Yes, when I use
(Label)a.Item.Controls[0].FindControl("Label1").Text
it works! How can I write code accepted both ItemTemplates - in repeater
code or loaded from template file?
Thanks
Petr
"Patrice Scribe" <no****@nowhere.com> píse v diskusním príspevku
news:uy**************@TK2MSFTNGP12.phx.gbl... Can you find this control in the hierarchy (enable the trace ?)
I's perhaps because you should find starting with the naming container
that contains this Label1 control ?
(Label)a.Item.FindControl("SomeINamingContainer"). FindControl("Label1").Text
etc...
Patrice
--
"P.L." <neuvedena> a écrit dans le message de
news:OT**************@TK2MSFTNGP10.phx.gbl... Hi!
I have problem with Datarepeater control. When I load template from
external aspx file
ItemTemplate = Page.LoadTemplate(....);
I can't find control in ItemDataBound event.
((Label)e.Item.FindControl("Label1")).Text = "text";
Can someone help me?
Petr