Hello John,
From your description, you're encountering some problem when try to access
a TextBox in the repeater control's template and the repeater is inside a
usercontrol which are used in the main page, correct?
Based on the code your provided, I think the problem here is that you
directly try locating the "Textbox"(which is inside repeater's
itemTemplate) through UserControl.FindControl method. This won't work since
you need to first get reference to the repeater control, and then locate
the certain RepeaterItem (since it will contains multiple RepeaterItem
after performing databinding). After that, you can call "FindControl"
method on the RepeaterItem instance to locate the TextBox. So the code
will look like below:
===================
Dim rpt As Repeater
rpt = RegistrationE11 .FindControl("repUpdate")
If Not rpt Is Nothing Then
For Each item As RepeaterItem In rpt.Items
Dim txt As TextBox = item.FindControl("RegIDE1")
txt.Text = txt.Text & "_updated"
Next
End If
End Sub
====================
Anyway, the basic rule is that if the control you want to locate is nested
in another control(which has implemented INamingContainer interface), you
need to find that control first and then call FindControl recursively to
locate its child controls.
BTW, for inspecting the control hierarchy in ASP.NET page, you can turn on
the output trace in the @Page directive. This is very help since it will
display the complete ASP.NET server control tree of the current page. You
can get the path you need to go through when try locating a control:
<%@ Page Language="C#" ............................. Trace="true"%>
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.