473,493 Members | 4,355 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why I can't find control

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

Nov 18 '05 #1
3 1742
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


Nov 18 '05 #2
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

Nov 18 '05 #3
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



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10904
by: bill yeager | last post by:
I have a datagrid control within a datalist control. When I try and do a "Find" on the control, the object comes back with nothing and then my pgm crashes. I am 100% sure that my datagird inside...
12
3777
by: Marc | last post by:
Hi, How can i increase the mousehover event timer? AddHandler NewBtn.MouseHover, AddressOf Shownotes Private Sub Shownotes(ByVal sender As System.Object, ByVal e As System.EventArgs)...
1
24982
by: Salim | last post by:
Hi, I'm trying to get UniqueID of a linkbutton. I have 2 web user controls. And a master page. In fisrst web user control there is a datalist. In datalist ItemCreated event, I try to find...
3
1595
by: ma | last post by:
Hello, I download AJAXToolKit today and install it and configured my MSVC 2005 to use it. But there is no TabPanle control in it. I had an installation some month ago and it had TabPanel control...
0
1628
by: marcellus7 | last post by:
Im looking for an image viewer that supports most types of image formats, including PDFs, and has the ability to rotate/zoom, and draw on an image. I've been looking but to no avail. Does anyone have...
0
7118
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.