Using FindControl to search for control inside of ObjectList's ItemTemplate

V

Vlad

Hello,

I have a DataBind event handler and want to find some control by
it's ID in a current row ObjectListItem (...EventArgs.ListItem).
I do as curtain MSDN - use ObjectListItem.FindControl("id") but method
returns me null. I used to use this FindControl technique
in Web forms but seems like it doesn't work in mobile forms ?

Also I've discovered that ObjectListItem.Controls.Count = 0 too,
so of course it doesn't find anything, but how to do it ???

Thanks,

Slava
 
R

R. Thomas, aka Xtreme.Net

If the count is 0, that means there is nothing inside... can u make sure that
the count is not 0 before searchin? did u add the controls to where u think
you did?
R. Thomas
 
V

Vlad

Hi Thomas,

I do databinding in LoadList event handler.
lstContacts.DataSource = tPage;
lstContacts.DataBind();

Ok, thanks, I'll check all again, maybe DataBind event is raised before
controls are added.

Slava
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top